Rename DatabaseOutOfDate's parameter 'current' -> 'existing'.

This commit is contained in:
voussoir 2018-11-24 22:06:16 -08:00
parent 1f45be9c39
commit 1eb5a6f465
2 changed files with 4 additions and 8 deletions

View file

@ -165,7 +165,7 @@ class BadDataDirectory(EtiquetteException):
error_message = 'Bad data directory "{}"' error_message = 'Bad data directory "{}"'
OUTOFDATE = ''' OUTOFDATE = '''
Database is out of date. {current} should be {new}. Database is out of date. {existing} should be {new}.
Please use utilities\\database_upgrader\\database_upgrader.py Please use utilities\\database_upgrader\\database_upgrader.py
'''.strip() '''.strip()
class DatabaseOutOfDate(EtiquetteException): class DatabaseOutOfDate(EtiquetteException):

View file

@ -1333,13 +1333,9 @@ class PhotoDB(
Compare database's user_version against constants.DATABASE_VERSION, Compare database's user_version against constants.DATABASE_VERSION,
raising exceptions.DatabaseOutOfDate if not correct. raising exceptions.DatabaseOutOfDate if not correct.
''' '''
existing_version = self.sql_execute('PRAGMA user_version').fetchone()[0] existing = self.sql_execute('PRAGMA user_version').fetchone()[0]
if existing_version != constants.DATABASE_VERSION: if existing != constants.DATABASE_VERSION:
exc = exceptions.DatabaseOutOfDate( raise exceptions.DatabaseOutOfDate(existing=existing, new=constants.DATABASE_VERSION)
current=existing_version,
new=constants.DATABASE_VERSION,
)
raise exc
def _first_time_setup(self): def _first_time_setup(self):
self.log.debug('Running first-time setup.') self.log.debug('Running first-time setup.')