summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-09-16 10:45:18 -0300
committerDuda Dornelles <ddornell@thoughtworks.com>2014-09-16 10:45:18 -0300
commit82276ba1c8d42ba0fb24832bfbfb711484192c2c (patch)
tree44ea5f6e06a1e0c931b22b72bc3e4122d7ceee54 /service
parent5dc16a1e654e78d9b600578a0e2276cba8d94158 (diff)
fixing mail ident and tags for drafts
Diffstat (limited to 'service')
-rw-r--r--service/pixelated/adapter/mail_service.py1
-rw-r--r--service/pixelated/adapter/pixelated_mail.py7
2 files changed, 5 insertions, 3 deletions
diff --git a/service/pixelated/adapter/mail_service.py b/service/pixelated/adapter/mail_service.py
index 5f651187..6239f2d9 100644
--- a/service/pixelated/adapter/mail_service.py
+++ b/service/pixelated/adapter/mail_service.py
@@ -43,6 +43,7 @@ class MailService:
return new_tags
def mail(self, mail_id):
+ import pdb;pdb.set_trace()
return self.mailboxes.mail(mail_id)
def send(self, mail):
diff --git a/service/pixelated/adapter/pixelated_mail.py b/service/pixelated/adapter/pixelated_mail.py
index 92b55ad4..f6e02882 100644
--- a/service/pixelated/adapter/pixelated_mail.py
+++ b/service/pixelated/adapter/pixelated_mail.py
@@ -27,11 +27,9 @@ class PixelatedMail:
def __init__(self):
self.body = ''
self.headers = {}
- self.ident = None
self.status = []
self.security_casing = {}
self.tags = []
- self.ident = None
@staticmethod
def from_leap_mail(leap_mail, leap_mailbox=None):
@@ -80,7 +78,10 @@ class PixelatedMail:
return temporary_headers
def _extract_tags(self):
- return set(json.loads(self.headers.get('x-tags', '[]')))
+ tags = self.headers.get('x-tags', '[]')
+ if type(tags) is list:
+ return set(tags)
+ return set(json.loads(tags))
def update_tags(self, tags):
old_tags = self.tags