mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 16:24:18 +03:00
Merge pull request #4006 from mochawich/patch-1
Reorder initializing the view
This commit is contained in:
commit
67ac0486f5
|
@ -372,11 +372,6 @@ class APIView(View):
|
|||
"""
|
||||
self.format_kwarg = self.get_format_suffix(**kwargs)
|
||||
|
||||
# Ensure that the incoming request is permitted
|
||||
self.perform_authentication(request)
|
||||
self.check_permissions(request)
|
||||
self.check_throttles(request)
|
||||
|
||||
# Perform content negotiation and store the accepted info on the request
|
||||
neg = self.perform_content_negotiation(request)
|
||||
request.accepted_renderer, request.accepted_media_type = neg
|
||||
|
@ -385,6 +380,11 @@ class APIView(View):
|
|||
version, scheme = self.determine_version(request, *args, **kwargs)
|
||||
request.version, request.versioning_scheme = version, scheme
|
||||
|
||||
# Ensure that the incoming request is permitted
|
||||
self.perform_authentication(request)
|
||||
self.check_permissions(request)
|
||||
self.check_throttles(request)
|
||||
|
||||
def finalize_response(self, request, response, *args, **kwargs):
|
||||
"""
|
||||
Returns the final response object.
|
||||
|
|
Loading…
Reference in New Issue
Block a user