summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/services/mail_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/pixelated/adapter/services/mail_service.py')
-rw-r--r--service/pixelated/adapter/services/mail_service.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py
index 1e0a0414..40a7c6ff 100644
--- a/service/pixelated/adapter/services/mail_service.py
+++ b/service/pixelated/adapter/services/mail_service.py
@@ -35,7 +35,7 @@ class MailService:
return self.querier.mails(mail_ids), total
def update_tags(self, mail_id, new_tags):
- new_tags = [x.lower() for x in map(lambda e: e.strip(), new_tags) if x != '']
+ new_tags = self._filter_white_space_tags(new_tags)
reserved_words = self.tag_service.extract_reserved(new_tags)
if len(reserved_words):
raise ValueError('None of the following words can be used as tags: ' + ' '.join(reserved_words))
@@ -45,6 +45,9 @@ class MailService:
return mail
+ def _filter_white_space_tags(self, tags):
+ return filter(bool, map(lambda e: e.strip(), tags))
+
def mail(self, mail_id):
return self.querier.mail(mail_id)