@@ -115,7 +115,8 @@ def get(self, request, *args, **kwargs):
115
115
kwargs ['scopes_descriptions' ] = [oauth2_settings .SCOPES [scope ] for scope in scopes ]
116
116
kwargs ['scopes' ] = scopes
117
117
# at this point we know an Application instance with such client_id exists in the database
118
- kwargs ['application' ] = Application .objects .get (client_id = credentials ['client_id' ]) # TODO: cache it!
118
+ application = Application .objects .get (client_id = credentials ['client_id' ]) # TODO: cache it!
119
+ kwargs ['application' ] = application
119
120
kwargs .update (credentials )
120
121
self .oauth2_data = kwargs
121
122
# following two loc are here only because of https://code.djangoproject.com/ticket/17795
@@ -126,10 +127,11 @@ def get(self, request, *args, **kwargs):
126
127
# a successful response depending on 'approval_prompt' url parameter
127
128
require_approval = request .GET .get ('approval_prompt' , oauth2_settings .REQUEST_APPROVAL_PROMPT )
128
129
129
- # if skip_authorization_completely is True, skip the authorization screen even
130
- # if this is the first use of the application and there was no previous authorization
131
- # useful for in-house applications-> assume an in-house applications are already approved.
132
- if self .skip_authorization_completely :
130
+ # If skip_authorization field is True, skip the authorization screen even
131
+ # if this is the first use of the application and there was no previous authorization.
132
+ # This is useful for in-house applications-> assume an in-house applications
133
+ # are already approved.
134
+ if application .skip_authorization :
133
135
uri , headers , body , status = self .create_authorization_response (
134
136
request = self .request , scopes = " " .join (scopes ),
135
137
credentials = credentials , allow = True )
0 commit comments