diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/pixelated/adapter/pixelated_mail.py | 4 | ||||
-rw-r--r-- | service/pixelated/adapter/tag.py | 3 | ||||
-rw-r--r-- | service/test/adapter/test_tag.py | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/service/pixelated/adapter/pixelated_mail.py b/service/pixelated/adapter/pixelated_mail.py index 31e8ccc7..2b9ccd35 100644 --- a/service/pixelated/adapter/pixelated_mail.py +++ b/service/pixelated/adapter/pixelated_mail.py @@ -82,7 +82,7 @@ class PixelatedMail: def _persist_mail_tags(self, current_tags): hdoc = self.leap_mail.hdoc - hdoc.content['headers']['X-Tags'] = current_tags + hdoc.content['headers']['X-Tags'] = list(current_tags) self.leap_mail._soledad.put_doc(hdoc) def has_tag(self, tag): @@ -95,7 +95,7 @@ class PixelatedMail: return { 'header': _headers, 'ident': self.ident, - 'tags': self.tags, + 'tags': list(self.tags), 'status': statuses, 'security_casing': self.security_casing, 'body': self.body diff --git a/service/pixelated/adapter/tag.py b/service/pixelated/adapter/tag.py index 45a972ab..ba545043 100644 --- a/service/pixelated/adapter/tag.py +++ b/service/pixelated/adapter/tag.py @@ -62,12 +62,11 @@ class Tag: 'read': 0, 'starred': 0, 'replied': 0}, - 'mails': self.mails + 'mails': list(self.mails) } def as_json_string(self): tag_dict = self.as_dict() - tag_dict['mails'] = list(self.mails) return json.dumps(tag_dict) def __repr__(self): diff --git a/service/test/adapter/test_tag.py b/service/test/adapter/test_tag.py index 1f0478d3..85887d37 100644 --- a/service/test/adapter/test_tag.py +++ b/service/test/adapter/test_tag.py @@ -39,7 +39,7 @@ class TestTag(unittest.TestCase): def test_as_dict_puts_all_tag_attributes_in_the_returning_dict(self): tag = Tag('some_tag', default=True) tag.counts = {'total': 0, 'read': 0, 'starred': 0, 'replied': 0} - tag.mails = set([1, 2, 3]) + tag.mails = [1, 2, 3] tag_dict = tag.as_dict() |