rejected users do not occupy a username
parent
e59bd893fd
commit
31adb3cc3a
|
@ -23,7 +23,7 @@ def validate_username(username):
|
||||||
raise ValidationError('Username too short.')
|
raise ValidationError('Username too short.')
|
||||||
if not USERNAME_RE.match(username):
|
if not USERNAME_RE.match(username):
|
||||||
raise ValidationError('Username must be all lowercase, start with a letter, and only use the _ special character')
|
raise ValidationError('Username must be all lowercase, start with a letter, and only use the _ special character')
|
||||||
duplicate = Townie.objects.filter(username=username).count()
|
duplicate = Townie.objects.filter(username=username).exclude(state=Townie.REJECTED).count()
|
||||||
if duplicate > 0:
|
if duplicate > 0:
|
||||||
raise ValidationError('Username already in use :(')
|
raise ValidationError('Username already in use :(')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue