def validate_password(form, field): user = User.get_by_id(current_user.id) if not user.check_password(field.data): raise ValidationError(_("Password is wrong."))
def validate_name(form, field): user = User.get_by_id(current_user.id) if not user.check_name(field.data): raise ValidationError(_("Please pick another name."))