Fix sqlite's conn may be None if never used

This happened when signing up with the library
and getting migrate errors.
This commit is contained in:
Lonami Exo 2018-09-04 11:28:01 +02:00
parent bbeb8f4ba3
commit 3c92f6a791

View File

@ -231,6 +231,7 @@ class SQLiteSession(MemorySession):
"""Saves the current session object as session_user_id.session""" """Saves the current session object as session_user_id.session"""
# This is a no-op if there are no changes to commit, so there's # This is a no-op if there are no changes to commit, so there's
# no need for us to keep track of an "unsaved changes" variable. # no need for us to keep track of an "unsaved changes" variable.
if self._conn is not None:
self._conn.commit() self._conn.commit()
def _cursor(self): def _cursor(self):