summaryrefslogtreecommitdiff
path: root/service/app
diff options
context:
space:
mode:
Diffstat (limited to 'service/app')
-rw-r--r--service/app/adapter/mail_service.py3
-rw-r--r--service/app/pixelated_user_agent.py5
2 files changed, 4 insertions, 4 deletions
diff --git a/service/app/adapter/mail_service.py b/service/app/adapter/mail_service.py
index 73baef56..1025bce8 100644
--- a/service/app/adapter/mail_service.py
+++ b/service/app/adapter/mail_service.py
@@ -54,7 +54,8 @@ class MailService:
def mails(self, query):
return self.mailbox.messages or []
- def update_tags(self, mail, new_tags):
+ def update_tags(self, mail_id, new_tags):
+ mail = self.mail(mail_id)
new_tags = mail.update_tags(new_tags)
self._update_tag_list(new_tags)
return mail
diff --git a/service/app/pixelated_user_agent.py b/service/app/pixelated_user_agent.py
index 3315999b..739cb57f 100644
--- a/service/app/pixelated_user_agent.py
+++ b/service/app/pixelated_user_agent.py
@@ -100,9 +100,8 @@ def mail(mail_id):
@app.route('/mail/<mail_id>/tags', methods=['POST'])
def mail_tags(mail_id):
new_tags = request.get_json()['newtags']
- mail = mail_service.mail(mail_id)
- mail_service.update_tags(mail, new_tags)
- tag_names = [tag.name for tag in mail.tags]
+ tags = mail_service.update_tags(mail_id, new_tags)
+ tag_names = [tag.name for tag in tags]
return respond_json(tag_names)