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:
parent
3840443159
commit
c5c7de8b2b
@ -351,9 +351,9 @@ def validate_quota(quota):
|
|||||||
|
|
||||||
if quota == "":
|
if quota == "":
|
||||||
raise ValueError("No quota provided.")
|
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.")
|
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.")
|
raise ValueError("Invalid quota.")
|
||||||
|
|
||||||
return quota
|
return quota
|
||||||
|
Loading…
Reference in New Issue
Block a user