Compare commits
No commits in common. "35235aa29c8b67f1ed4cdb3b31901009201527c9" and "24233147ad610f8335afdb89c13a1cdc5b32e210" have entirely different histories.
35235aa29c
...
24233147ad
3 changed files with 15 additions and 10 deletions
|
@ -26,23 +26,23 @@ class EditProfileForm(FlaskForm):
|
|||
submit = SubmitField('Update')
|
||||
|
||||
class EditProfileAdminForm(FlaskForm):
|
||||
email = StringField('Email login address:', [validators.DataRequired(), validators.Length(1, 64), validators.Email()])
|
||||
email = StringField('Електроннa поща (логин):', [validators.DataRequired(), validators.Length(1, 64), validators.Email()])
|
||||
confirmed = BooleanField('Activated')
|
||||
role = SelectField('Role', coerce=int)
|
||||
|
||||
name = StringField('Contact name:', [validators.DataRequired(), validators.Length(3, 60)])
|
||||
address = StringField('Address:', [validators.DataRequired(), validators.Length(2, 50)])
|
||||
city = StringField('City:', [validators.DataRequired(), validators.Length(2,40)])
|
||||
postcode = DecimalField('Postcode:')
|
||||
name = StringField('Лице за контакт:', [validators.DataRequired(), validators.Length(3, 60)])
|
||||
address = StringField('Адрес:', [validators.DataRequired(), validators.Length(2, 50)])
|
||||
city = StringField('Град:', [validators.DataRequired(), validators.Length(2,40)])
|
||||
postcode = DecimalField('Пощенски Код:')
|
||||
|
||||
clist = []
|
||||
for c in countries:
|
||||
clist.append((c.alpha2, c.name))
|
||||
country = SelectField('Country:', choices=clist)
|
||||
country = SelectField('Държава:', choices=clist)
|
||||
|
||||
phone = DecimalField('Phone:', [validators.DataRequired()])
|
||||
phone = DecimalField('Телефон:', [validators.DataRequired()])
|
||||
twofactor = BooleanField('2-factor authentication')
|
||||
submit = SubmitField('Renew')
|
||||
submit = SubmitField('Обнови')
|
||||
|
||||
def __init__(self, user, *args, **kwargs):
|
||||
super(EditProfileAdminForm, self).__init__(*args, **kwargs)
|
||||
|
@ -52,6 +52,6 @@ class EditProfileAdminForm(FlaskForm):
|
|||
|
||||
def validate_email(self, field):
|
||||
if field.data != self.user.email and User.query.filter_by(email=field.data).first():
|
||||
raise ValidationError('The mail address is already registered.')
|
||||
raise ValidationError('Email-а е вече регистриран.')
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ def profile():
|
|||
current_user.twofactor = form.twofactor.data
|
||||
db.session.add(current_user)
|
||||
db.session.commit()
|
||||
flash('Profile info Updated!')
|
||||
flash('Info Updated!')
|
||||
|
||||
form.name.data = current_user.name
|
||||
form.address.data = current_user.address
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -93,6 +94,10 @@
|
|||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue