From 31adb3cc3a8ff52faa67226379c80ecbeac08d02 Mon Sep 17 00:00:00 2001 From: Nate Smith Date: Mon, 15 Jul 2019 21:15:33 -0500 Subject: [PATCH] rejected users do not occupy a username --- ttadmin/users/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttadmin/users/forms.py b/ttadmin/users/forms.py index ae843e7..b5ae3ea 100644 --- a/ttadmin/users/forms.py +++ b/ttadmin/users/forms.py @@ -23,7 +23,7 @@ def validate_username(username): raise ValidationError('Username too short.') if not USERNAME_RE.match(username): 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: raise ValidationError('Username already in use :(')