HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/aigenerator/venv/lib/python3.12/site-packages/allauth/usersessions/adapter.py
from allauth.core.internal.adapter import BaseAdapter
from allauth.usersessions import app_settings
from allauth.utils import import_attribute


class DefaultUserSessionsAdapter(BaseAdapter):
    """The adapter class allows you to override various functionality of the
    ``allauth.usersessions`` app.  To do so, point
    ``settings.USERSESSIONS_ADAPTER`` to your own class that derives from
    ``DefaultUserSessionsAdapter`` and override the behavior by altering the
    implementation of the methods according to your own needs.
    """

    def end_sessions(self, sessions):
        for session in sessions:
            session.end()


def get_adapter():
    return import_attribute(app_settings.ADAPTER)()