allow decimal points in quotas

This commit is contained in:
John Supplee 2019-01-29 17:42:17 +02:00
parent 3840443159
commit c5c7de8b2b
1 changed files with 2 additions and 2 deletions

View File

@ -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