Skip to content
Snippets Groups Projects
Commit 8a6a5271 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Prevent account creation when authenticated

parent fe070ddf
No related branches found
No related tags found
No related merge requests found
Pipeline #14163 failed
...@@ -9,6 +9,7 @@ from django.contrib.auth.forms import PasswordChangeForm ...@@ -9,6 +9,7 @@ from django.contrib.auth.forms import PasswordChangeForm
from django.core.mail import send_mail from django.core.mail import send_mail
from django.db.models import ProtectedError from django.db.models import ProtectedError
from django.forms import widgets from django.forms import widgets
from django.http import HttpResponseForbidden
from django.shortcuts import render, redirect from django.shortcuts import render, redirect
from django.template import TemplateDoesNotExist from django.template import TemplateDoesNotExist
from django.utils.translation import ugettext from django.utils.translation import ugettext
...@@ -49,6 +50,8 @@ def change_password(request): ...@@ -49,6 +50,8 @@ def change_password(request):
def signup(request): def signup(request):
if not request.user.is_anonymous:
return HttpResponseForbidden()
if request.method == 'POST': if request.method == 'POST':
form = UserCreationFormWithMore(request.POST) form = UserCreationFormWithMore(request.POST)
if form.is_valid(): if form.is_valid():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment