summaryrefslogtreecommitdiffstats
path: root/users/views
diff options
context:
space:
mode:
authorMichael Manfre2022-11-20 18:03:09 -0500
committerGitHub2022-11-20 16:03:09 -0700
commit61ce62b02627414e5d4c65d32146ba8dc89421c4 (patch)
tree268089638f2bd2eebe9d22cec4480a2420ce9fb6 /users/views
parent6e88c0096942e008bb55d29b5696a058a2c1e013 (diff)
downloadtakahe-61ce62b02627414e5d4c65d32146ba8dc89421c4.tar.gz
takahe-61ce62b02627414e5d4c65d32146ba8dc89421c4.tar.bz2
takahe-61ce62b02627414e5d4c65d32146ba8dc89421c4.zip
Enforce signups_allowed=False (#26)
Diffstat (limited to 'users/views')
-rw-r--r--users/views/auth.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/users/views/auth.py b/users/views/auth.py
index 2257ea5..61e9a29 100644
--- a/users/views/auth.py
+++ b/users/views/auth.py
@@ -49,6 +49,10 @@ class Signup(FormView):
raise forms.ValidationError("That is not a valid invite code")
return invite_code
+ def clean(self):
+ if not Config.system.signup_allowed:
+ raise forms.ValidationError("Not accepting new users at this time")
+
def form_valid(self, form):
user = User.objects.create(email=form.cleaned_data["email"])
# Auto-promote the user to admin if that setting is set