mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
[FEAT] Enable django-allauth for enhanced user management & federation
This commit is contained in:
16
breccia_mapper/account_adapter.py
Normal file
16
breccia_mapper/account_adapter.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from allauth.account.adapter import DefaultAccountAdapter
|
||||
from constance import config
|
||||
|
||||
|
||||
class ControlSignupsAccountAdapter(DefaultAccountAdapter):
|
||||
|
||||
def is_open_for_signup(self, request):
|
||||
"""
|
||||
Checks whether or not the site is open for signups.
|
||||
|
||||
Next to simply returning True/False you can also intervene the
|
||||
regular flow by raising an ImmediateHttpResponse
|
||||
|
||||
(Comment reproduced from the overridden method.)
|
||||
"""
|
||||
return config.ALLOW_SIGNUPS
|
||||
Reference in New Issue
Block a user