Resolve django 1.11 migration errors.

This commit is contained in:
Griatch 2017-06-17 22:15:00 +02:00
commit 0ff1718437
54 changed files with 6444 additions and 574 deletions

View file

@ -58,7 +58,7 @@ class ObjectSessionHandler(object):
self._sessid_cache = list(set(int(val) for val in (self.obj.db_sessid or "").split(",") if val))
if any(sessid for sessid in self._sessid_cache if sessid not in _SESSIONS):
# cache is out of sync with sessionhandler! Only retain the ones in the handler.
self.sessid_cache = [sessid for sessid in self._sessid_cache if sessid in _SESSIONS]
self._sessid_cache = [sessid for sessid in self._sessid_cache if sessid in _SESSIONS]
self.obj.db_sessid = ",".join(str(val) for val in self._sessid_cache)
self.obj.save(update_fields=["db_sessid"])