# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-05-08 17:49
from __future__ import unicode_literals

from django.db import migrations
from django.core import management
from django.contrib.sessions.models import Session
from django.utils.timezone import now


def expire_all_sessions(apps, schema_editor):
    # Clear any expired sessions.
    management.call_command("clearsessions")
    # Set any remaining sessions to expire.
    sessions = Session.objects.all()
    for session in sessions:
        session.expire_date = now()
        session.save()

    # Clear those sessions too.
    management.call_command("clearsessions")


class Migration(migrations.Migration):

    dependencies = [("users", "0055_remove_authorization_partner")]

    operations = [migrations.RunPython(expire_all_sessions)]

Add migration clearing all sessions.
Add migration clearing all sessions.
