Minor fix to sync attrs to make it less stupid.

This commit is contained in:
Andrew Bastien 2020-04-18 08:12:16 -07:00
parent b82cce6cb2
commit fe98b5c6cc

View file

@ -101,7 +101,7 @@ class Session(object):
the keys given by self._attrs_to_sync.
"""
return {attr: getattr(self, attr, None) for attr in settings.SESSION_SYNC_ATTRS}
return {attr: getattr(self, attr) for attr in settings.SESSION_SYNC_ATTRS if hasattr(self, attr)}
def load_sync_data(self, sessdata):
"""