summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-11-23 11:24:40 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-11-23 11:24:40 -0300
commit8349915f538e670cd86b7327e31fd6bd87500db2 (patch)
treef579f8909ae29916c298d4d2d0ed737087bc4815 /service/pixelated
parent3281c5eade3fadb32e199210ace922e3db8f6da6 (diff)
No more 'need to create before delete'
Checking for mdoc existence before trying to delete a deleted mail. --Issue #512
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index 42e065ac..4348347e 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -289,7 +289,9 @@ class LeapMailStore(MailStore):
@defer.inlineCallbacks
def delete_mail(self, mail_id):
message = yield self._fetch_msg_from_soledad(mail_id)
- yield message.get_wrapper().delete(self.soledad)
+ message_wrapper = message.get_wrapper()
+ if message_wrapper.mdoc.doc_id:
+ yield message_wrapper.delete(self.soledad)
@defer.inlineCallbacks
def get_mailbox_mail_ids(self, mailbox_name):