mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 09:19:16 +02:00
Fix #58: enabling registrations is now done via a preference
This commit is contained in:
parent
3c1e76e95d
commit
3dd1a20b68
3 changed files with 22 additions and 12 deletions
|
@ -1,15 +1,10 @@
|
|||
from allauth.account.adapter import DefaultAccountAdapter
|
||||
|
||||
from django.conf import settings
|
||||
from dynamic_preferences.registries import global_preferences_registry
|
||||
|
||||
|
||||
class FunkwhaleAccountAdapter(DefaultAccountAdapter):
|
||||
|
||||
def is_open_for_signup(self, request):
|
||||
|
||||
if settings.REGISTRATION_MODE == "disabled":
|
||||
return False
|
||||
if settings.REGISTRATION_MODE == "public":
|
||||
return True
|
||||
|
||||
return False
|
||||
manager = global_preferences_registry.manager()
|
||||
return manager['users__registration_enabled']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue