Skip to content

Commit 67ac048

Browse files
committed
Merge pull request encode#4006 from mochawich/patch-1
Reorder initializing the view
2 parents 6b1125a + 0327043 commit 67ac048

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rest_framework/views.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,6 @@ def initial(self, request, *args, **kwargs):
372372
"""
373373
self.format_kwarg = self.get_format_suffix(**kwargs)
374374

375-
# Ensure that the incoming request is permitted
376-
self.perform_authentication(request)
377-
self.check_permissions(request)
378-
self.check_throttles(request)
379-
380375
# Perform content negotiation and store the accepted info on the request
381376
neg = self.perform_content_negotiation(request)
382377
request.accepted_renderer, request.accepted_media_type = neg
@@ -385,6 +380,11 @@ def initial(self, request, *args, **kwargs):
385380
version, scheme = self.determine_version(request, *args, **kwargs)
386381
request.version, request.versioning_scheme = version, scheme
387382

383+
# Ensure that the incoming request is permitted
384+
self.perform_authentication(request)
385+
self.check_permissions(request)
386+
self.check_throttles(request)
387+
388388
def finalize_response(self, request, response, *args, **kwargs):
389389
"""
390390
Returns the final response object.

0 commit comments

Comments
 (0)