1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-25 07:47:05 +00:00

allow decimal points in quotas

This commit is contained in:
John Supplee 2019-01-29 17:42:17 +02:00
parent 3840443159
commit c5c7de8b2b

View File

@ -351,9 +351,9 @@ def validate_quota(quota):
if quota == "":
raise ValueError("No quota provided.")
if re.search(r"[\s,.]", quota):
if re.search(r"[\s,]", quota):
raise ValueError("Quotas cannot contain spaces or commas.")
if not re.match(r'^\d+[GM]?$', quota):
if not re.match(r'^[\d\.]+[GM]?$', quota):
raise ValueError("Invalid quota.")
return quota