Commit 8a6a5271 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Prevent account creation when authenticated

parent fe070ddf
Pipeline #14163 failed with stage
in 22 seconds
......@@ -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
......@@ -49,6 +50,8 @@ def change_password(request):
def signup(request):
if not request.user.is_anonymous:
return HttpResponseForbidden()
if request.method == 'POST':
form = UserCreationFormWithMore(request.POST)
if form.is_valid():
......
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