diff options
author | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-08 17:54:46 +0100 |
---|---|---|
committer | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-02-08 18:10:53 +0100 |
commit | 91223543207c4a56370ff609df9912a5b11262d7 (patch) | |
tree | 64718bc37657fa4fae1771f517e584cfee796f82 | |
parent | 7b5aa81b6d1b3ceeeae7a158bc0f0535a6040846 (diff) |
Revert "Issue #549 - Implemented remove attachment in server side"
This reverts commit 92f0e9887a216e0ec82355941655d3deebf2d422.
-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): |