diff --git a/core/templates/registration/registration_closed.html b/core/templates/registration/registration_closed.html new file mode 100644 index 0000000..f0a7ca1 --- /dev/null +++ b/core/templates/registration/registration_closed.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% load static %} +{% load crispy_forms_tags %} + +{% block content %} +
+
+
+
+
+
+

Registration closed.

+
+
+
+
+
+
+{% endblock %} diff --git a/core/views/base.py b/core/views/base.py index 777ca03..6347332 100644 --- a/core/views/base.py +++ b/core/views/base.py @@ -91,6 +91,10 @@ class Signup(CreateView): success_url = reverse_lazy("login") template_name = "registration/signup.html" + def get(self, request, *args, **kwargs): + if not settings.REGISTRATION_OPEN: + return render(request, "registration/registration_closed.html") + super().get(request, *args, **kwargs) class Portal(LoginRequiredMixin, View): async def get(self, request):