Commit 240bdb42 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Prevent account creation when authenticated

parent fe070ddf
......@@ -9,6 +9,7 @@ from django.contrib.auth.forms import PasswordChangeForm
from django.core.mail import send_mail
from django.db.models import ProtectedError
from django.forms import widgets
from django.http import HttpResponseForbidden
from django.shortcuts import render, redirect
from django.template import TemplateDoesNotExist
from django.utils.translation import ugettext
......@@ -82,6 +83,8 @@ def signup(request):
login(request, user)
return redirect('home')
if not request.user.is_anonymous:
return HttpResponseForbidden()
form = UserCreationFormWithMore()
return render(request, 'registration/signup.html', {'form': form})
{% load i18n %}
<!-- **** Begin Fork-Me-On-Gitlab-Ribbon-HTML. See MIT License at **** -->
<a href="">
<span class="fork_me">{%trans "Fork Me"%}</span>
<!-- **** End Fork-Me-On-Gitlab-Ribbon-HTML **** -->
\ No newline at end of file
{% load basetheme_bootstrap %}
{% load i18n %}
<li class="nav-item"><a class="nav-link" href="/"><i class="fa fa-table"></i> Theme BS4</a></li>
<li class="nav-item"><a class="nav-link" href="/themePasteur"><i class="fa fa-map-signs"></i> Theme BS4 Pasteur</a></li>
<li class="nav-item {{ request|is_active_or_desc:'basetheme_bootstrap:about_page'}}"><a href="{% url 'basetheme_bootstrap:about_page'%}" class="nav-link">{%trans "About"%}</a></li>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment