Add registration closed template and handler
This commit is contained in:
parent
8a6ca7c2c9
commit
d805a39466
|
@ -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 %}
|
|
@ -91,6 +91,10 @@ class Signup(CreateView):
|
||||||
success_url = reverse_lazy("login")
|
success_url = reverse_lazy("login")
|
||||||
template_name = "registration/signup.html"
|
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):
|
class Portal(LoginRequiredMixin, View):
|
||||||
async def get(self, request):
|
async def get(self, request):
|
||||||
|
|
Loading…
Reference in New Issue