Update OutOfDate message to show actual argument.

This commit is contained in:
voussoir 2020-01-28 10:52:19 -08:00
parent 93eb693bee
commit 2ffe3940e6
2 changed files with 6 additions and 2 deletions

View file

@ -166,7 +166,7 @@ class BadDataDirectory(EtiquetteException):
OUTOFDATE = '''
Database is out of date. {existing} should be {new}.
Please use utilities\\database_upgrader\\database_upgrader.py
Please run utilities\\database_upgrader\\database_upgrader.py "{filepath.absolute_path}"
'''.strip()
class DatabaseOutOfDate(EtiquetteException):
'''

View file

@ -1349,7 +1349,11 @@ class PhotoDB(
'''
existing = self.sql_execute('PRAGMA user_version').fetchone()[0]
if existing != constants.DATABASE_VERSION:
raise exceptions.DatabaseOutOfDate(existing=existing, new=constants.DATABASE_VERSION)
raise exceptions.DatabaseOutOfDate(
existing=existing,
new=constants.DATABASE_VERSION,
filepath=self.database_filepath,
)
def _first_time_setup(self):
self.log.debug('Running first-time database setup.')