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

master
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 "{}"'
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
'''.strip()
class DatabaseOutOfDate(EtiquetteException):

View File

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