mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-06-25 21:50:55 +00:00
Fixed EM101 (raw-string-in-exception): Exception must not use a string literal, assign to variable first
This commit is contained in:
parent
3a1280d292
commit
3008dfa28f
@ -430,11 +430,14 @@ def validate_quota(quota):
|
||||
quota = quota.strip().upper()
|
||||
|
||||
if quota == "":
|
||||
raise ValueError("No quota provided.")
|
||||
msg = "No quota provided."
|
||||
raise ValueError(msg)
|
||||
if re.search(r"[\s,.]", quota):
|
||||
raise ValueError("Quotas cannot contain spaces, commas, or decimal points.")
|
||||
msg = "Quotas cannot contain spaces, commas, or decimal points."
|
||||
raise ValueError(msg)
|
||||
if not re.match(r'^[\d]+[GM]?$', quota):
|
||||
raise ValueError("Invalid quota.")
|
||||
msg = "Invalid quota."
|
||||
raise ValueError(msg)
|
||||
|
||||
return quota
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user