Made username creation/login case insensitive.

This commit is contained in:
Kelketek 2013-05-13 12:30:00 -05:00
parent 53581637d8
commit e752c2dd64
5 changed files with 57 additions and 7 deletions

View file

@ -432,9 +432,6 @@ def create_player(name, email, password,
set any in this case.
"""
# The system should already have checked so the name/email
# isn't already registered, and that the password is ok before
# getting here.
global _PlayerDB, _Player
if not _PlayerDB:
from src.players.models import PlayerDB as _PlayerDB
@ -446,7 +443,17 @@ def create_player(name, email, password,
if user:
new_user = user
email = user.email
if user:
conflict_check = User.objects.filter(username__iexact=user.username)
conflict_check = len(conflict_check) > 1
else:
conflict_check = User.objects.filter(username__iexact=name)
if conflict_check:
raise ValueError("A user with this name already exists.")
if not user:
if is_superuser:
new_user = User.objects.create_superuser(name, email, password)
else: