Handle infinite quotas when adding validators, fixes #162

master
Pierre Jaury 8 years ago
parent 67647df83a
commit fe0b292d45

@ -22,6 +22,7 @@ def user_create(domain_name):
return flask.redirect(
flask.url_for('.user_list', domain_name=domain.name))
form = forms.UserForm()
if domain.max_quota_bytes:
form.quota_bytes.validators = [
wtforms.validators.NumberRange(max=domain.max_quota_bytes)]
if form.validate_on_submit():
@ -53,6 +54,7 @@ def user_edit(user_email):
wtforms_components.read_only(form.localpart)
form.pw.validators = []
form.localpart.validators = []
if max_quota_bytes:
form.quota_bytes.validators = [
wtforms.validators.NumberRange(max=max_quota_bytes)]
if form.validate_on_submit():

Loading…
Cancel
Save