check allowed methods before checking permissions and stuff

This commit is contained in:
ludbek 2016-08-01 15:45:27 +05:45
parent 48a2f084aa
commit 36639f4765

View File

@ -451,10 +451,10 @@ class APIView(View):
self.headers = self.default_response_headers # deprecate? self.headers = self.default_response_headers # deprecate?
try: try:
self.initial(request, *args, **kwargs)
# Get the appropriate handler method # Get the appropriate handler method
if request.method.lower() in self.http_method_names: if request.method.lower() in self.http_method_names:
self.initial(request, *args, **kwargs)
handler = getattr(self, request.method.lower(), handler = getattr(self, request.method.lower(),
self.http_method_not_allowed) self.http_method_not_allowed)
else: else: