Browse Source

we add a verification that the email is already configured to avoid an error while creating a user and sending a confirmation email

pull/250/head
Guillim 5 years ago
parent
commit
d8a132d3c0
2 changed files with 15 additions and 0 deletions
  1. 12
      app/authentification/templates/email_not_set.html
  2. 3
      app/authentification/views.py

12
app/authentification/templates/email_not_set.html

@ -0,0 +1,12 @@
{% extends "base_auth.html" %}
{% block content_auth %}
<div class="card-content">
<p>
The webmaster hasn't set up any emails yet, so we can't send you any link confirmation
</p>
<p>
Please contact the admin to learn more
</p>
</div>
{% endblock %}

3
app/authentification/views.py

@ -26,6 +26,9 @@ class SignupView(TemplateView):
if not bool(settings.ALLOW_SIGNUP):
return redirect('signup')
if not hasattr(settings, "EMAIL_BACKEND") or not hasattr(settings, "EMAIL_HOST"):
return render(request, 'email_not_set.html')
if form.is_valid():
user = form.save(commit=False)
user.is_active = False

Loading…
Cancel
Save