diff options
author | Patrick Maia <patrickjourdanmaia@gmail.com> | 2014-10-01 16:43:29 -0300 |
---|---|---|
committer | Patrick Maia <patrickjourdanmaia@gmail.com> | 2014-10-01 16:43:43 -0300 |
commit | aa04ff3742e53bff9f5369ab7357050b7c2947a3 (patch) | |
tree | 3d5bf18bc6a2ba631b2c6e64279c639f7117fdc7 /service | |
parent | 97a5e93f5b569556a6eb8b257647a0a757b328b8 (diff) |
#53 - gives better feedback on UI when attempt to add invalid tag is made
Diffstat (limited to 'service')
-rw-r--r-- | service/integration/tags_test.py | 2 | ||||
-rw-r--r-- | service/pixelated/adapter/mail_service.py | 3 |
2 files changed, 2 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. 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)) |