made it possible to disable signup
This commit is contained in:
15
cookbook/helper/AllAuthCustomAdapter.py
Normal file
15
cookbook/helper/AllAuthCustomAdapter.py
Normal 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)
|
Reference in New Issue
Block a user