File: 0003_sessions.py

package info (click to toggle)
django-mailman3 1.3.15-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,544 kB
  • sloc: python: 2,186; makefile: 18; javascript: 14; sh: 7
file content (26 lines) | stat: -rw-r--r-- 550 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# -*- coding: utf-8 -*-


from django.contrib.sessions.models import Session
from django.db import migrations


def clear_session(app, schema_editor):
    Session.objects.all().delete()

def undo(app, schema_editor):
    # In case we need to back it out. We can't really restore the table so
    # just pass.
    pass


class Migration(migrations.Migration):

    dependencies = [
        ('sessions', '0001_initial'),
        ('django_mailman3', '0002_maildomain'),
    ]

    operations = [
        migrations.RunPython(clear_session, undo),
    ]