diff --git a/src/backend/InvenTree/users/migrations/0011_auto_20240523_1640.py b/src/backend/InvenTree/users/migrations/0011_auto_20240523_1640.py index 1673fcc89971..cdda226fe9d3 100644 --- a/src/backend/InvenTree/users/migrations/0011_auto_20240523_1640.py +++ b/src/backend/InvenTree/users/migrations/0011_auto_20240523_1640.py @@ -9,12 +9,17 @@ def clear_sessions(apps, schema_editor): """Clear all user sessions.""" - engine = import_module(settings.SESSION_ENGINE) - engine.SessionStore.clear_expired() - print('Cleared all user sessions to deal with GHSA-2crp-q9pc-457j') - + try: + engine = import_module(settings.SESSION_ENGINE) + engine.SessionStore.clear_expired() + print('Cleared all user sessions to deal with GHSA-2crp-q9pc-457j') + except Exception: + # Database may not be ready yet, so this does not matter anyhow + pass class Migration(migrations.Migration): + atomic = False + dependencies = [ ("users", "0010_alter_apitoken_key"), ]