Debian Codegraph @

django_mailman3/migrations/0003_sessions.py

raw
1 # -*- coding: utf-8 -*-
2
3
4 from django.contrib.sessions.models import Session
5 from django.db import migrations
6
7
8 def clear_session(app, schema_editor):
9 Session.objects.all().delete()
10
11 def undo(app, schema_editor):
12 # In case we need to back it out. We can't really restore the table so
13 # just pass.
14 pass
15
16
17 class Migration(migrations.Migration):
18
19 dependencies = [
20 ('sessions', '0001_initial'),
21 ('django_mailman3', '0002_maildomain'),
22 ]
23
24 operations = [
25 migrations.RunPython(clear_session, undo),
26 ]