diff options
author | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-16 13:53:16 +0200 |
---|---|---|
committer | Duda Dornelles <ddornell@thoughtworks.com> | 2014-10-16 13:54:03 +0200 |
commit | 0de9d8dc31298921f7272d74cdd3c5d4217b5841 (patch) | |
tree | 468ba5005379151eff72c5aaaf37db9ba29b3ef7 /service/pixelated/controllers/mails_controller.py | |
parent | 761e85e523ec61f5629a9f1f6e4196e23ce96673 (diff) |
decreasing count on tag and tag shortcut when email is read. we were
decreasing only tags that were also in the read mail, but we have also
to look at the mailbox and compare that to the tags in the case of
default tags #95
Diffstat (limited to 'service/pixelated/controllers/mails_controller.py')
-rw-r--r-- | service/pixelated/controllers/mails_controller.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/service/pixelated/controllers/mails_controller.py b/service/pixelated/controllers/mails_controller.py index 6bd2fe99..f6414f27 100644 --- a/service/pixelated/controllers/mails_controller.py +++ b/service/pixelated/controllers/mails_controller.py @@ -92,11 +92,12 @@ class MailsController: def mail_tags(self, mail_id): new_tags = map(lambda tag: tag.lower(), request.get_json()['newtags']) try: - tags = self._mail_service.update_tags(mail_id, new_tags) - self._search_engine.index_mail(self._mail_service.mail(mail_id)) + self._mail_service.update_tags(mail_id, new_tags) + mail = self._mail_service.mail(mail_id) + self._search_engine.index_mail(mail) except ValueError as ve: return respond_json(ve.message, 403) - return respond_json(list(tags)) + return respond_json(mail.as_dict()) def update_draft(self): _mail = InputMail.from_dict(request.json) |