From 88abefd3e62fb65a08dde62a7d7e4ce1fa22f563 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 6 Oct 2014 12:05:49 -0300 Subject: fix a couple of bugs recovering tag from a pickled json --- service/pixelated/adapter/tag.py | 2 +- service/pixelated/adapter/tag_service.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'service/pixelated') diff --git a/service/pixelated/adapter/tag.py b/service/pixelated/adapter/tag.py index 2e965fdf..d75022f9 100644 --- a/service/pixelated/adapter/tag.py +++ b/service/pixelated/adapter/tag.py @@ -22,7 +22,7 @@ class Tag: @classmethod def from_dict(cls, tag_dict): tag = Tag(tag_dict['name'], tag_dict['default']) - tag.mails = tag_dict['mails'] + tag.mails = set(tag_dict['mails']) return tag @classmethod diff --git a/service/pixelated/adapter/tag_service.py b/service/pixelated/adapter/tag_service.py index dc13bc54..874a9a58 100644 --- a/service/pixelated/adapter/tag_service.py +++ b/service/pixelated/adapter/tag_service.py @@ -45,6 +45,8 @@ class TagService: def notify_tags_updated(self, added_tags, removed_tags, mail_ident): for removed_tag in removed_tags: tag = self.tag_index.get(removed_tag) + if not tag: + continue tag.decrement(mail_ident) if tag.total == 0: self.tag_index.remove(tag.name) -- cgit v1.2.3