fix username validation

This commit is contained in:
rimu 2024-01-10 09:00:24 +13:00
parent 94f1aad3c5
commit 6fba6ef113

View file

@ -30,7 +30,7 @@ class RegistrationForm(FlaskForm):
raise ValidationError(_('An account with this email address already exists.')) raise ValidationError(_('An account with this email address already exists.'))
def validate_user_name(self, user_name): def validate_user_name(self, user_name):
user = User.query.filter_by(user_name=user_name.data).first() user = User.query.filter_by(user_name=user_name.data, ap_id=None).first()
if user is not None: if user is not None:
if user.deleted: if user.deleted:
raise ValidationError(_('This username was used in the past and cannot be reused.')) raise ValidationError(_('This username was used in the past and cannot be reused.'))