summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
authorPatrick Maia and Victor Shyba <pixelated-team+pmaia+vshyba@thoughtworks.com>2014-08-22 17:12:56 +0000
committerPatrick Maia <pmaia@thoughtworks.com>2014-08-22 17:13:22 +0000
commit4685e3d8e6188951a897c25a4772ef227eb27683 (patch)
tree3b1b02c746a8b433dc27c85bd53272ad50c4d0db /service/pixelated/adapter
parent285f3e706195631e1094791e0399de4530f9a70d (diff)
fixes bug in which inbox special tag was being duplicated
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/mail_service.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py
index 6498a2e7..fc8002a1 100644
--- a/service/pixelated/adapter/mail_service.py
+++ b/service/pixelated/adapter/mail_service.py
@@ -30,7 +30,11 @@ class MailService:
self.provider = LeapProvider(self.server_name, self.leap_config)
self.leap_session = LeapSessionFactory(self.provider).create(LeapCredentials(self.username, self.password))
self.account = self.leap_session.account
- self.mailbox = self.account.getMailbox(self.mailbox_name)
+
+ @property
+ def mailbox(self):
+ return self.account.getMailbox(self.mailbox_name)
+
def mails(self, query):
mails = self.mailbox.messages or []
@@ -49,7 +53,7 @@ class MailService:
self.tags.add(tag)
def _update_flags(self, new_tags, mail_id):
- new_tags_flag_name = ['tag_' + tag.name for tag in new_tags]
+ new_tags_flag_name = ['tag_' + tag.name for tag in new_tags if tag.name not in Tags.SPECIAL_TAGS]
self.set_flags(mail_id, new_tags_flag_name)
def set_flags(self, mail_id, new_tags_flag_name):