Always remove the session when running check_db_up_to_date()
This commit sponsored by Francois Marier. Thank you!
This commit is contained in:
parent
8cfa4071bf
commit
cbc5f9500c
@ -76,11 +76,16 @@ def check_db_up_to_date():
|
|||||||
dbdatas = gather_database_data(mgg.global_config.get('plugins', {}).keys())
|
dbdatas = gather_database_data(mgg.global_config.get('plugins', {}).keys())
|
||||||
|
|
||||||
for dbdata in dbdatas:
|
for dbdata in dbdatas:
|
||||||
migration_manager = dbdata.make_migration_manager(Session())
|
session = Session()
|
||||||
if migration_manager.database_current_migration is None or \
|
try:
|
||||||
migration_manager.migrations_to_run():
|
migration_manager = dbdata.make_migration_manager(session)
|
||||||
sys.exit("Your database is not up to date. Please run "
|
if migration_manager.database_current_migration is None or \
|
||||||
"'gmg dbupdate' before starting MediaGoblin.")
|
migration_manager.migrations_to_run():
|
||||||
|
sys.exit("Your database is not up to date. Please run "
|
||||||
|
"'gmg dbupdate' before starting MediaGoblin.")
|
||||||
|
finally:
|
||||||
|
Session.rollback()
|
||||||
|
Session.remove()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user