diff --git a/shop/forms.py b/shop/forms.py index 0ac096d8c4ecc3fec2fde9041d69085977887d10..a8b371d6941695b08660fbdf5fe2a43a4d13ee5f 100644 --- a/shop/forms.py +++ b/shop/forms.py @@ -13,7 +13,7 @@ class SignupForm(FlaskForm): username = StringField('Username', validators=[input_required(), Length(1, 12)]) password = PasswordField('Password', validators=[input_required()]) verifyPassword = PasswordField('Verify password', validators=[input_required(), EqualTo('password', message='Passwords must match')]) - email = StringField('email', validators=[Regexp(regex="^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$", message = 'has to be a valid email'), input_required()]) + email = StringField('email', validators=[Regexp(regex="[^@]+@[^@]+.[^@]+", message = 'has to be a valid email'), input_required()]) mobile = StringField('mobile', validators=[Regexp(regex='^[+-]?[0-9]+$', message = 'only integers allowed'), input_required(), Length(11, 11)]) submit = SubmitField('Submit') @@ -52,7 +52,7 @@ class reviewForm(FlaskForm): submit1 = SubmitField('Submit') class emailChangeForm(FlaskForm): - new_email = StringField('Enter a new email:', validators=[Regexp(regex="^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$", message = 'has to be a valid email'), input_required()]) + new_email = StringField('Enter a new email:', validators=[Regexp(regex="[^@]+@[^@]+.[^@]+", message = 'has to be a valid email'), input_required()]) submit1 = SubmitField('Submit') class mobileChangeForm(FlaskForm): diff --git a/shop/templates/user_page.html b/shop/templates/user_page.html index f572cdf747fbe6baedd0f6200f87f920fb2fcb20..9cfc62d82b90123f0bfcdac1b479b0bef94b5415 100644 --- a/shop/templates/user_page.html +++ b/shop/templates/user_page.html @@ -34,6 +34,7 @@ </p> <p class="login_field"> {{ mobile_form.new_mobile.label }} {{ mobile_form.new_mobile(class = "input_field") }} {{ mobile_form.submit2(class = "input_field") }} + </p> </div> </form>