summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/resources/mail_resource.py2
-rw-r--r--service/test/integration/test_tags.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/service/pixelated/resources/mail_resource.py b/service/pixelated/resources/mail_resource.py
index 396ccd74..fd1d255f 100644
--- a/service/pixelated/resources/mail_resource.py
+++ b/service/pixelated/resources/mail_resource.py
@@ -15,7 +15,7 @@ class MailTags(Resource):
def render_POST(self, request):
content_dict = json.loads(request.content.read())
- new_tags = [x.lower() for x in content_dict['newtags'] if x != '']
+ new_tags = [x.lower() for x in map(lambda e: e.strip(), content_dict['newtags']) if x != '']
try:
self._mail_service.update_tags(self._mail_id, new_tags)
mail = self._mail_service.mail(self._mail_id)
diff --git a/service/test/integration/test_tags.py b/service/test/integration/test_tags.py
index b32e89c7..0efcbb6b 100644
--- a/service/test/integration/test_tags.py
+++ b/service/test/integration/test_tags.py
@@ -46,7 +46,7 @@ class TagsTest(SoledadTestBase):
mail = MailBuilder().with_subject('Mail with tags').build_input_mail()
self.client.add_mail_to_inbox(mail)
- self.post_tags(mail.ident, self._tags_json(['tag1', '']))
+ self.post_tags(mail.ident, self._tags_json(['tag1', ' ']))
mail = self.get_mail(mail.ident)