mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-20 05:19:38 +02:00
10 lines
342 B
Python
10 lines
342 B
Python
|
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
|