summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/pixelated/adapter/services/draft_service.py11
-rw-r--r--service/test/unit/adapter/test_draft_service.py2
2 files changed, 3 insertions, 10 deletions
diff --git a/service/pixelated/adapter/services/draft_service.py b/service/pixelated/adapter/services/draft_service.py
index d8e0f6dd..30d3020d 100644
--- a/service/pixelated/adapter/services/draft_service.py
+++ b/service/pixelated/adapter/services/draft_service.py
@@ -30,13 +30,6 @@ class DraftService(object):
@defer.inlineCallbacks
def update_draft(self, ident, input_mail):
+ yield self._mail_store.delete_mail(ident)
new_draft = yield self.create_draft(input_mail)
- try:
- yield self._mail_store.delete_mail(ident)
- defer.returnValue(new_draft)
- except Exception as error:
- errorMessage = error.args[0].getErrorMessage()
-
- if errorMessage == 'Need to create doc before deleting':
- yield self._mail_store.delete_mail(new_draft.ident)
- raise DuplicatedDraftException(errorMessage)
+ defer.returnValue(new_draft)
diff --git a/service/test/unit/adapter/test_draft_service.py b/service/test/unit/adapter/test_draft_service.py
index c2b7cd93..628b95d4 100644
--- a/service/test/unit/adapter/test_draft_service.py
+++ b/service/test/unit/adapter/test_draft_service.py
@@ -27,5 +27,5 @@ class DraftServiceTest(unittest.TestCase):
self.draft_service.update_draft(mail.ident, mail)
- inorder.verify(self.mail_store).add_mail('DRAFTS', mail.raw)
inorder.verify(self.mail_store).delete_mail(mail.ident)
+ inorder.verify(self.mail_store).add_mail('DRAFTS', mail.raw)