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

@ -0,0 +1,15 @@
from dynamic_preferences import types
from dynamic_preferences.registries import global_preferences_registry
users = types.Section('users')
@global_preferences_registry.register
class RegistrationEnabled(types.BooleanPreference):
show_in_api = True
section = users
name = 'registration_enabled'
default = False
verbose_name = (
'Can visitors open a new account on this instance?'
)