From 61ce62b02627414e5d4c65d32146ba8dc89421c4 Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Sun, 20 Nov 2022 18:03:09 -0500 Subject: Enforce signups_allowed=False (#26) --- users/views/auth.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'users/views') 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 -- cgit v1.2.3