summary refs log tree commit diff
path: root/synapse/rest/media/v1/upload_resource.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-05-10 15:26:53 +0100
committerGitHub <noreply@github.com>2018-05-10 15:26:53 +0100
commit7b411007e6558d5be835257e52a7479a375b027c (patch)
treed7c6f45ee742673f80fd88af9e7eb5a4e6b46ec1 /synapse/rest/media/v1/upload_resource.py
parentMerge pull request #3199 from matrix-org/erikj/pagination_sync (diff)
parentRemove redundant request_handler decorator (diff)
downloadsynapse-7b411007e6558d5be835257e52a7479a375b027c.tar.xz
Merge pull request #3203 from matrix-org/rav/refactor_request_handler
Refactor request handling wrappers
Diffstat (limited to 'synapse/rest/media/v1/upload_resource.py')
-rw-r--r--synapse/rest/media/v1/upload_resource.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/rest/media/v1/upload_resource.py b/synapse/rest/media/v1/upload_resource.py
index a31e75cb46..7d01c57fd1 100644
--- a/synapse/rest/media/v1/upload_resource.py
+++ b/synapse/rest/media/v1/upload_resource.py
@@ -13,16 +13,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from synapse.http.server import respond_with_json, request_handler
-
-from synapse.api.errors import SynapseError
+import logging
 
-from twisted.web.server import NOT_DONE_YET
 from twisted.internet import defer
-
 from twisted.web.resource import Resource
+from twisted.web.server import NOT_DONE_YET
 
-import logging
+from synapse.api.errors import SynapseError
+from synapse.http.server import (
+    respond_with_json,
+    wrap_json_request_handler,
+)
 
 logger = logging.getLogger(__name__)
 
@@ -51,7 +52,7 @@ class UploadResource(Resource):
         respond_with_json(request, 200, {}, send_cors=True)
         return NOT_DONE_YET
 
-    @request_handler()
+    @wrap_json_request_handler
     @defer.inlineCallbacks
     def _async_render_POST(self, request):
         requester = yield self.auth.get_user_by_req(request)