summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Post <cent@spline.de>2020-08-07 18:17:46 +0200
committerJonah BrĂ¼chert <jbb@kaidan.im>2023-05-22 00:28:12 +0200
commitd9337687df1c808304e2cca3d5302bc58eb7ee51 (patch)
tree4328ee541cf95b7b33a3cf38f9deaca9a93c81d0
parent955e66c149a8df3a1af78d8766eb46b78af76a82 (diff)
downloadweb-d9337687df1c808304e2cca3d5302bc58eb7ee51.tar.gz
web-d9337687df1c808304e2cca3d5302bc58eb7ee51.tar.bz2
web-d9337687df1c808304e2cca3d5302bc58eb7ee51.zip
Fixed recursion while deepcopy(Account)
-rw-r--r--accounts/models.py3
1 files changed, 2 insertions, 1 deletions
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'" %