diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2015-11-23 11:48:25 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2015-11-23 17:25:39 -0300 |
commit | 0900c714facb04bd7c990905a3578a703f4e9988 (patch) | |
tree | 7e0621772d74b7cbcaec22bd768d253e1e09c5cf /service/pixelated/adapter/services | |
parent | ac4425ce923143d7d9d50ffed720211858b9834f (diff) |
Checking on deletion errors on drafts isnt needed
As delete_mail checks for mail_id there will be no more need to create
errors.
--Issue #512
Diffstat (limited to 'service/pixelated/adapter/services')
-rw-r--r-- | service/pixelated/adapter/services/draft_service.py | 11 |
1 files changed, 2 insertions, 9 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) |