summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authormnandri <mnandri@eunglick.corporate.thoughtworks.com>2015-12-16 18:26:31 +0100
committermnandri <mnandri@eunglick.corporate.thoughtworks.com>2015-12-18 11:22:34 +0100
commit39fa6e68fc2afaafc0e8440d212b464d2e20c326 (patch)
tree03d090f7178a2d93a9c33cd072b0ff33fd9bd545 /service/pixelated
parent338498cef1cd4f2b9ae49bc54bd496de0e5472a0 (diff)
fixing unit test -- again WIP
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/adapter/services/mail_service.py1
-rw-r--r--service/pixelated/resources/attachments_resource.py5
2 files changed, 4 insertions, 2 deletions
diff --git a/service/pixelated/adapter/services/mail_service.py b/service/pixelated/adapter/services/mail_service.py
index 2f63a2bc..4c1c1c0d 100644
--- a/service/pixelated/adapter/services/mail_service.py
+++ b/service/pixelated/adapter/services/mail_service.py
@@ -25,6 +25,7 @@ from pixelated.adapter.model.status import Status
from pixelated.adapter.services.tag_service import extract_reserved_tags
from leap.mail.adaptors.soledad import SoledadMailAdaptor
+
class MailService(object):
def __init__(self, mail_sender, mail_store, search_engine, account_email):
diff --git a/service/pixelated/resources/attachments_resource.py b/service/pixelated/resources/attachments_resource.py
index 2b5a6912..911fc43d 100644
--- a/service/pixelated/resources/attachments_resource.py
+++ b/service/pixelated/resources/attachments_resource.py
@@ -87,12 +87,13 @@ class AttachmentsResource(Resource):
'</body></html>'
def render_POST(self, request):
- fields = cgi.FieldStorage(fp=request.content, headers=request.headers, environ={'REQUEST_METHOD':'POST'})
+ fields = cgi.FieldStorage(fp=request.content, headers=(request.getAllHeaders()),
+ environ={'REQUEST_METHOD': 'POST'})
_file = fields['attachment']
deferred = defer.maybeDeferred(self.mail_service.attachment_id, _file.value, _file.type)
def send_location(attachment_id):
- request.headers['Location'] = '/%s/%s'% (self.BASE_URL, attachment_id)
+ request.headers['Location'] = '/%s/%s' % (self.BASE_URL, attachment_id)
respond_json_deferred({"attachment_id": attachment_id}, request, status_code=201)
def error_handler(error):