Commit ab7eccda authored by pitchum's avatar pitchum
Browse files

Return HTTP status 405 instead of 500 + stacktrace + email.

parent 6e290ffe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@ class Resource(MethodView, REST):

    def dispatch_request(self, *args, **kwargs):
        meth = getattr(self, request.method.lower(), None)
        if not meth:
            return self.negociated_resp(None, 405, None) # 405 Method not allowed
        resp = meth(*args, **kwargs)
        if isinstance(resp, Response):
            return resp