mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-01-25 14:58:42 -05: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 |