diff --git a/ietf/ietfauth/forms.py b/ietf/ietfauth/forms.py index ab42fd144..65bad7dfe 100644 --- a/ietf/ietfauth/forms.py +++ b/ietf/ietfauth/forms.py @@ -256,3 +256,9 @@ class ChangeUsernameForm(forms.Form): if not self.user.check_password(password): raise ValidationError('Invalid password') return password + + def clean_username(self): + username = self.cleaned_data['username'] + if User.objects.filter(username=username).exists(): + raise ValidationError("A login with that username already exists. Please contact the secretariat to get this resolved.") + return username