~homeworkprod/byceps

0f366d3d1aba7fae51951724c922b428fc1b13e8 — Jochen Kupperschmidt 8 months ago 613a349
Validate screen name, email address in admin update forms

Prevents unhandled duplicate key exceptions in the database.
1 files changed, 2 insertions(+), 1 deletions(-)

M byceps/blueprints/admin/user/forms.py
M byceps/blueprints/admin/user/forms.py => byceps/blueprints/admin/user/forms.py +2 -1
@@ 44,7 44,7 @@ def validate_screen_name_availability(form, field):
class ChangeEmailAddressForm(LocalizedForm):
    email_address = StringField(
        lazy_gettext('New email address'),
        [InputRequired(), Length(min=6, max=120)],
        [InputRequired(), Length(min=6, max=120), validate_email_address],
    )
    reason = TextAreaField(
        lazy_gettext('Reason'),


@@ 62,6 62,7 @@ class ChangeScreenNameForm(LocalizedForm):
                max=screen_name_validator.MAX_LENGTH,
            ),
            ScreenNameValidator(),
            validate_screen_name_availability,
        ],
    )
    reason = TextAreaField(