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/lib64/python3.12/site-packages/social_django/__init__.py
__version__ = "5.4.2"


from social_core.backends.base import BaseAuth

# django.contrib.auth.load_backend() will import and instanciate the
# authentication backend ignoring the possibility that it might
# require more arguments. Here we set a monkey patch to
# BaseAuth.__init__ to ignore the mandatory strategy argument and load
# it.


def baseauth_init_workaround(original_init):
    def fake_init(self, strategy=None, *args, **kwargs):
        from .utils import load_strategy

        original_init(self, strategy or load_strategy(), *args, **kwargs)

    return fake_init


if not getattr(BaseAuth, "__init_patched", False):
    BaseAuth.__init__ = baseauth_init_workaround(BaseAuth.__init__)
    BaseAuth.__init_patched = True