Fix #58: enabling registrations is now done via a preference

This commit is contained in:
Eliot Berriot 2018-02-24 12:20:42 +01:00
parent 3c1e76e95d
commit 3dd1a20b68
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 22 additions and 12 deletions

View file

@ -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']