summary refs log tree commit diff
path: root/synapse/media/v1/upload_resource.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-12-10 15:46:18 +0000
committerMark Haines <mark.haines@matrix.org>2014-12-10 15:46:18 +0000
commite5275d856ee7a1d7aeccd3ea6ab97b49456d24c9 (patch)
tree80ad9c576d4f11988ff674d45ed17a7c2cd9fda8 /synapse/media/v1/upload_resource.py
parentThumbnail uploaded and cached images (diff)
downloadsynapse-e5275d856ee7a1d7aeccd3ea6ab97b49456d24c9.tar.xz
Get the code actually working
Diffstat (limited to 'synapse/media/v1/upload_resource.py')
-rw-r--r--synapse/media/v1/upload_resource.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/media/v1/upload_resource.py b/synapse/media/v1/upload_resource.py

index a78cc3cff3..b2449ff03d 100644 --- a/synapse/media/v1/upload_resource.py +++ b/synapse/media/v1/upload_resource.py
@@ -23,9 +23,7 @@ from synapse.api.errors import ( from twisted.web.server import NOT_DONE_YET from twisted.internet import defer -from .baseresource import BaseMediaResource - -import os +from .base_resource import BaseMediaResource import logging @@ -75,7 +73,7 @@ class UploadResource(BaseMediaResource): media_id = random_string(24) fname = self.filepaths.local_media_filepath(media_id) - os.makedirs(os.path.dirname(fname)) + self._makedirs(fname) # This shouldn't block for very long because the content will have # already been uploaded at this point. @@ -95,7 +93,7 @@ class UploadResource(BaseMediaResource): "media_length": content_length, } - yield self._generate_local_thumbnails(self, media_id, media_info) + yield self._generate_local_thumbnails(media_id, media_info) respond_with_json( request, 200, {"content_token": media_id}, send_cors=True