Add registration closed template and handler

This commit is contained in:
Mark Veidemanis 2022-11-03 07:20:30 +00:00
parent 8a6ca7c2c9
commit d805a39466
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,19 @@
{% extends "base.html" %}
{% load static %}
{% load crispy_forms_tags %}
{% block content %}
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container">
<div class="columns is-centered">
<div class="column is-5-tablet is-4-desktop is-3-widescreen">
<div class="box">
<p class="has-text-danger">Registration closed.</p>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %}

View File

@ -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):