diff options
author | Vincent Post <cent@spline.de> | 2020-08-07 18:17:46 +0200 |
---|---|---|
committer | Vincent Post <cent@spline.de> | 2020-08-07 18:18:06 +0200 |
commit | 74aa9fa461302441ddea3a87c3e0f938dc6bdc2b (patch) | |
tree | 9bd27fab5339024fd9c22f52ae8b0d614e7cd594 | |
parent | 960b340a7e549080e039bc6f8ab6b31b18f904f6 (diff) | |
download | web-74aa9fa461302441ddea3a87c3e0f938dc6bdc2b.tar.gz web-74aa9fa461302441ddea3a87c3e0f938dc6bdc2b.tar.bz2 web-74aa9fa461302441ddea3a87c3e0f938dc6bdc2b.zip |
Fixed recursion while deepcopy(Account)
-rw-r--r-- | accounts/models.py | 3 |
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'" % |