aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/users/adapters.py
blob: b75f31ace766556c5b64f90105e4f473e7c8788c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from allauth.account.adapter import DefaultAccountAdapter
# from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from django.conf import settings
from django.http import HttpRequest


class AccountAdapter(DefaultAccountAdapter):
    def is_open_for_signup(self, request: HttpRequest):
        return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)


# class SocialAccountAdapter(DefaultSocialAccountAdapter):
#     def is_open_for_signup(self, request: HttpRequest, sociallogin: Any):
#         return getattr(settings, "ACCOUNT_ALLOW_REGISTRATION", True)