From d9337687df1c808304e2cca3d5302bc58eb7ee51 Mon Sep 17 00:00:00 2001 From: Vincent Post Date: Fri, 7 Aug 2020 18:17:46 +0200 Subject: Fixed recursion while deepcopy(Account) --- accounts/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accounts/models.py b/accounts/models.py index aa0e4d0..45648a4 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -51,7 +51,8 @@ class Account(UserMixin): self._set_attribute('mail', new_mail) def __getattr__(self, name): - if name in self.attributes: + # https://stackoverflow.com/a/47300262 + if name[:2] != "__" and name in self.attributes: return self.attributes[name] raise AttributeError("'%s' object has no attribute '%s'" % -- cgit v1.2.3-1-g7c22