Skip to content

Commit

Permalink
modify username generation to remove special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfskaempf committed Feb 23, 2017
1 parent d67e8f6 commit ea32317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion statistics/views/public_views.py
Expand Up @@ -20,6 +20,7 @@
from django.contrib import messages
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.text import slugify

# Import the markdown parser used to display the changelog nicely
import mistune
Expand Down Expand Up @@ -217,7 +218,7 @@ def create_session(request):
gender = False

# Creating a lowercase string with no spaces from the session name to use for usernames
name = ''.join(form.cleaned_data['name'].split()).lower()
name = slugify(''.join(form.cleaned_data['name'].split()).lower())

# Creating the Admin user
admin_user = User.objects.create_user(username=name + '_admin',
Expand Down

0 comments on commit ea32317

Please sign in to comment.