mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Handle exception on migration (#7322)
* Handle exception on migration * Make migration non-atomic
This commit is contained in:
parent
0e1b78d88b
commit
0c56bd8dfa
@ -9,12 +9,17 @@ from django.db import migrations
|
||||
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"),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user