diff options
-rw-r--r-- | service/pixelated/adapter/services/mail_service.py | 3 | ||||
-rw-r--r-- | service/pixelated/resources/attachments_resource.py | 13 |
2 files changed, 3 insertions, 13 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py index d2506dcf..5ec3a298 100644 --- a/service/pixelated/adapter/services/mail_service.py +++ b/service/pixelated/adapter/services/mail_service.py @@ -152,5 +152,6 @@ class MailService(object): def delete_permanent(self, mail_id): yield self.mail_store.delete_mail(mail_id) + @defer.inlineCallbacks def delete_attachment(self, attachment_id): - return self.attachment_store.delete_attachment(attachment_id) + yield self.attachment_store.delete_attachment(attachment_id) diff --git a/service/pixelated/resources/attachments_resource.py b/service/pixelated/resources/attachments_resource.py index 9e4e8a5f..401fb321 100644 --- a/service/pixelated/resources/attachments_resource.py +++ b/service/pixelated/resources/attachments_resource.py @@ -72,18 +72,7 @@ class AttachmentResource(Resource): return match.group(1) def render_DELETE(self, request): - def success(_): - response_json = {"ident": self.attachment_id} - respond_json_deferred(response_json, request, status_code=200) - - def failure(err): - request.code = 500 - request.finish() - - d = self.mail_service.delete_attachment(self.attachment_id) - d.addCallback(success) - d.addErrback(failure) - return server.NOT_DONE_YET + self.mail_service.delete_attachment(self.attachment_id) class AttachmentsResource(BaseResource): |