diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-10 12:10:27 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-10 12:19:53 +0100 |
commit | 645cb4bf06deee1c4c10ecc3d7df2c914168f19a (patch) | |
tree | d7c6f45ee742673f80fd88af9e7eb5a4e6b46ec1 /synapse/rest/media/v1/upload_resource.py | |
parent | Factor wrap_request_handler_with_logging out of wrap_request_handler (diff) | |
download | synapse-645cb4bf06deee1c4c10ecc3d7df2c914168f19a.tar.xz |
Remove redundant request_handler decorator
This is needless complexity; we might as well use the wrapper directly. Also rename wrap_request_handler->wrap_json_request_handler.
Diffstat (limited to 'synapse/rest/media/v1/upload_resource.py')
-rw-r--r-- | synapse/rest/media/v1/upload_resource.py | 15 |
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) |