diff --git a/etiquette/exceptions.py b/etiquette/exceptions.py index 88d13e8..22d7202 100644 --- a/etiquette/exceptions.py +++ b/etiquette/exceptions.py @@ -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): diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 8318ef7..4a789ce 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -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.')