mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-06 00:26:08 +02:00
Fix the behaviour from Wtforms Components regarding readonly, related to #152
This commit is contained in:
parent
a74c9a1e87
commit
41b1666609
@ -41,6 +41,7 @@ def alias_edit(alias):
|
|||||||
alias = models.Alias.query.get(alias) or flask.abort(404)
|
alias = models.Alias.query.get(alias) or flask.abort(404)
|
||||||
form = forms.AliasForm(obj=alias)
|
form = forms.AliasForm(obj=alias)
|
||||||
wtforms_components.read_only(form.localpart)
|
wtforms_components.read_only(form.localpart)
|
||||||
|
form.localpart.validators = []
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
form.populate_obj(alias)
|
form.populate_obj(alias)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
@ -34,6 +34,7 @@ def domain_edit(domain_name):
|
|||||||
domain = models.Domain.query.get(domain_name) or flask.abort(404)
|
domain = models.Domain.query.get(domain_name) or flask.abort(404)
|
||||||
form = forms.DomainForm(obj=domain)
|
form = forms.DomainForm(obj=domain)
|
||||||
wtforms_components.read_only(form.name)
|
wtforms_components.read_only(form.name)
|
||||||
|
form.name.validators = []
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
form.populate_obj(domain)
|
form.populate_obj(domain)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
@ -44,6 +44,7 @@ def user_edit(user_email):
|
|||||||
form = forms.UserForm(obj=user)
|
form = forms.UserForm(obj=user)
|
||||||
wtforms_components.read_only(form.localpart)
|
wtforms_components.read_only(form.localpart)
|
||||||
form.pw.validators = []
|
form.pw.validators = []
|
||||||
|
form.localpart.validators = []
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
form.populate_obj(user)
|
form.populate_obj(user)
|
||||||
if form.pw.data:
|
if form.pw.data:
|
||||||
|
Loading…
Reference in New Issue
Block a user