Fix the behaviour from Wtforms Components regarding readonly, related to #152

master
Pierre Jaury 8 years ago
parent a74c9a1e87
commit 41b1666609

@ -41,6 +41,7 @@ def alias_edit(alias):
alias = models.Alias.query.get(alias) or flask.abort(404)
form = forms.AliasForm(obj=alias)
wtforms_components.read_only(form.localpart)
form.localpart.validators = []
if form.validate_on_submit():
form.populate_obj(alias)
db.session.commit()

@ -34,6 +34,7 @@ def domain_edit(domain_name):
domain = models.Domain.query.get(domain_name) or flask.abort(404)
form = forms.DomainForm(obj=domain)
wtforms_components.read_only(form.name)
form.name.validators = []
if form.validate_on_submit():
form.populate_obj(domain)
db.session.commit()

@ -44,6 +44,7 @@ def user_edit(user_email):
form = forms.UserForm(obj=user)
wtforms_components.read_only(form.localpart)
form.pw.validators = []
form.localpart.validators = []
if form.validate_on_submit():
form.populate_obj(user)
if form.pw.data:

Loading…
Cancel
Save