mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Remove try/except + test
Changes in d064ff5 made try/except unnecessary and the subsequent test failed.
This commit is contained in:
parent
dee691b72b
commit
959f80604a
@ -92,18 +92,13 @@ class TagMailAction(BaseMailAction):
|
|||||||
|
|
||||||
# The custom tag should look like "apple:<color>"
|
# The custom tag should look like "apple:<color>"
|
||||||
if "apple:" in parameter.lower():
|
if "apple:" in parameter.lower():
|
||||||
try:
|
|
||||||
_, self.color = parameter.split(":")
|
_, self.color = parameter.split(":")
|
||||||
self.color = self.color.strip()
|
self.color = self.color.strip()
|
||||||
|
|
||||||
if not self.color.lower() in APPLE_MAIL_TAG_COLORS.keys():
|
if not self.color.lower() in APPLE_MAIL_TAG_COLORS.keys():
|
||||||
raise MailError("Not a valid AppleMail tag color.")
|
raise MailError("Not a valid AppleMail tag color.")
|
||||||
except Exception as e:
|
|
||||||
raise MailError(
|
|
||||||
"""Could not parse parameters.
|
|
||||||
Make sure they look like this: apple:<color> and
|
|
||||||
only use allowed colors.""",
|
|
||||||
) from e
|
|
||||||
self.keyword = None
|
self.keyword = None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -682,11 +682,6 @@ class TestMail(DirectoriesMixin, TestCase):
|
|||||||
TagMailAction,
|
TagMailAction,
|
||||||
"apple:black",
|
"apple:black",
|
||||||
)
|
)
|
||||||
self.assertRaises(
|
|
||||||
MailError,
|
|
||||||
TagMailAction,
|
|
||||||
"applegreen",
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_handle_mail_account_tag_applemail(self):
|
def test_handle_mail_account_tag_applemail(self):
|
||||||
# all mails will be FLAGGED afterwards
|
# all mails will be FLAGGED afterwards
|
||||||
|
Loading…
x
Reference in New Issue
Block a user