mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-21 05:49:37 +02:00
10 lines
No EOL
342 B
Python
10 lines
No EOL
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 |