From 5204e11e63274f2b2f18a72cc43925cfc58d32ed Mon Sep 17 00:00:00 2001 From: Jordan Robinson Date: Sun, 14 Sep 2025 18:49:23 +0100 Subject: [PATCH] fix user update form to account for allow_docs_user env variable --- main/util.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/util.py b/main/util.py index 3b06c503e562926e974f58b04920ad66c39ecff5..365b4b24ea26361621b78e7d3909945eb3c090e1 100644 --- a/main/util.py +++ b/main/util.py @@ -24,7 +24,13 @@ def is_disallowed(username): if username[0] == "_": # do not allow leading underscores return True - return username in denylist.DISALLOWED_USERNAMES + + if username == "docs" and settings.ALLOW_DOCS_USER: + return False + + # check if subdomain is disallowed + if username in denylist.DISALLOWED_USERNAMES and not settings.ALLOW_DOCS_USER: + return username in denylist.DISALLOWED_USERNAMES def get_approx_number(number):