Initial migration to new session based auth system with AllAuth
This commit is contained in:
10
backend/server/users/adapters.py
Normal file
10
backend/server/users/adapters.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from allauth.account.adapter import DefaultAccountAdapter
|
||||
from django.conf import settings
|
||||
|
||||
class NoNewUsersAccountAdapter(DefaultAccountAdapter):
|
||||
"""
|
||||
Disable new user registration.
|
||||
"""
|
||||
def is_open_for_signup(self, request):
|
||||
is_disabled = getattr(settings, 'DISABLE_REGISTRATION', False)
|
||||
return not is_disabled
|
||||
Reference in New Issue
Block a user