Use .cleaned_data rather than sanitising identifiers twice.

(imported from commit c691e010f94e623706167a91ccfd505fae02f609)
This commit is contained in:
Luke Faraone
2012-09-26 14:10:34 -04:00
parent 57810d41ac
commit 05e64f904d

View File

@@ -58,11 +58,11 @@ def register(request):
form = RegistrationForm(request.POST)
if form.is_valid():
password = request.POST['password']
full_name = strip_html(request.POST['full_name'])
short_name = strip_html(request.POST['short_name'])
email = strip_html(request.POST['email'])
domain = strip_html(request.POST['domain'])
password = strip_html(form.cleaned_data['password'])
full_name = strip_html(form.cleaned_data['full_name'])
short_name = strip_html(email.split('@')[0])
email = strip_html(form.cleaned_data['email'])
domain = strip_html(form.cleaned_data['domain'])
realm = Realm.objects.filter(domain=domain)
if not realm:
realm = Realm(domain=domain)