made it possible to disable signup

This commit is contained in:
vabene1111
2021-01-24 16:41:25 +01:00
parent 098f88e0b8
commit ca728b45ca
3 changed files with 43 additions and 21 deletions

View File

@@ -0,0 +1,15 @@
from django.conf import settings
from allauth.account.adapter import DefaultAccountAdapter
class AllAuthCustomAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
"""
Whether to allow sign ups.
"""
allow_signups = super(
AllAuthCustomAdapter, self).is_open_for_signup(request)
# Override with setting, otherwise default to super.
return getattr(settings, 'ACCOUNT_ALLOW_SIGNUPS', allow_signups)

View File

@@ -1,4 +1,5 @@
import cookbook.helper.dal
from cookbook.helper.AllAuthCustomAdapter import AllAuthCustomAdapter
__all__ = [
'dal',