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 7d78eda3fd
commit 6cf005a645

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):
"""