mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
Add system check for SINGLE_USER mode
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
from django.core.checks import Warning, register
|
||||||
|
|
||||||
|
|
||||||
|
@register("users")
|
||||||
|
def check_single_user_implies_disabled_registration(app_configs, **kwargs):
|
||||||
|
from bugsink.app_settings import get_settings
|
||||||
|
errors = []
|
||||||
|
if get_settings().SINGLE_USER and get_settings().USER_REGISTRATION != "CB_NOBODY":
|
||||||
|
errors.append(
|
||||||
|
Warning(
|
||||||
|
"You're in SINGLE_USER mode, but USER_REGISTRATION is not set to 'CB_NOBODY'. This means that users "
|
||||||
|
"can still register, which is probably not what you want.",
|
||||||
|
id="users.W001",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return errors
|
||||||
|
|||||||
Reference in New Issue
Block a user