From aa04ff3742e53bff9f5369ab7357050b7c2947a3 Mon Sep 17 00:00:00 2001 From: Patrick Maia Date: Wed, 1 Oct 2014 16:43:29 -0300 Subject: #53 - gives better feedback on UI when attempt to add invalid tag is made --- service/integration/tags_test.py | 2 +- service/pixelated/adapter/mail_service.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'service') diff --git a/service/integration/tags_test.py b/service/integration/tags_test.py index 13e1c22d..b313caec 100644 --- a/service/integration/tags_test.py +++ b/service/integration/tags_test.py @@ -46,7 +46,7 @@ class TagsTest(unittest.TestCase, SoledadTestBase): self.pixelated_mailboxes.inbox().add(mail) response = self.post_tags(mail.ident, self._tags_json(['DRAFTS'])) - self.assertEquals("None of the following words can be used as tags: ['drafts']", response) + self.assertEquals("None of the following words can be used as tags: drafts", response) mail = self.pixelated_mailboxes.inbox().mail(mail.ident) self.assertNotIn('drafts', mail.tags) diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py index 8be04984..23afb41b 100644 --- a/service/pixelated/adapter/mail_service.py +++ b/service/pixelated/adapter/mail_service.py @@ -14,7 +14,6 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . from pixelated.adapter.tag_service import TagService -from pixelated.adapter.pixelated_mail import PixelatedMail from pixelated.adapter.soledad_querier import SoledadQuerier @@ -37,7 +36,7 @@ class MailService: def update_tags(self, mail_id, 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: %s' % list(reserved_words)) + raise ValueError('None of the following words can be used as tags: ' + ' '.join(reserved_words)) mail = self.mail(mail_id) return mail.update_tags(set(new_tags)) -- cgit v1.2.3