Apply DEFAULT_QUOTA to user creation admin ui page

This commit is contained in:
PM Extra
2023-02-23 20:32:19 +08:00
committed by GitHub
parent 0de2430868
commit 80d861523b
2 changed files with 4 additions and 1 deletions

View File

@@ -27,6 +27,8 @@ def user_create(domain_name):
if domain.max_quota_bytes:
form.quota_bytes.validators = [
wtforms.validators.NumberRange(max=domain.max_quota_bytes)]
if form.quota_bytes.default > domain.max_quota_bytes:
form.quota_bytes.default = domain.max_quota_bytes
if form.validate_on_submit():
if msg := utils.isBadOrPwned(form):
flask.flash(msg, "error")