Fixed EM101 (raw-string-in-exception): Exception must not use a string literal, assign to variable first

This commit is contained in:
Teal Dulcet
2025-06-18 05:00:45 -07:00
parent 3a1280d292
commit 3008dfa28f
+6 -3
View File
@@ -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