From 3008dfa28fa5d20f29cd3f2c2d8973226fc8a450 Mon Sep 17 00:00:00 2001 From: Teal Dulcet Date: Wed, 18 Jun 2025 04:19:36 -0700 Subject: [PATCH] Fixed EM101 (raw-string-in-exception): Exception must not use a string literal, assign to variable first --- management/mailconfig.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/management/mailconfig.py b/management/mailconfig.py index 9e883121..98d8f005 100755 --- a/management/mailconfig.py +++ b/management/mailconfig.py @@ -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