Skip to content

Commit fbfc48c

Browse files
committed
chore: copilot comments
django-oauth#1252 (review)
1 parent 747a0c5 commit fbfc48c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _authenticate_basic_auth(self, request):
159159
try:
160160
client_id, client_secret = map(unquote_plus, auth_string_decoded.split(":", 1))
161161
except ValueError:
162-
log.debug("Failed basic auth, Invalid base64 encoding.")
162+
log.debug("Failed basic auth, Invalid base64 encoding")
163163
return False
164164

165165
if self._load_application(client_id, request) is None:
@@ -217,16 +217,16 @@ def _load_application(self, client_id, request):
217217
if request.client:
218218
# check for cached client, to save the db hit if this has already been loaded
219219
if not isinstance(request.client, Application):
220-
log.debug("request.client is not an Application, something else set request.client erroneously, resetting request.client.")
220+
log.debug("request.client is not an Application, something else set request.client erroneously, resetting request.client")
221221
request.client = None
222222
elif request.client.client_id != client_id:
223-
log.debug("request.client client_id does not match the given client_id, resetting request.client.")
223+
log.debug("request.client client_id does not match the given client_id, resetting request.client")
224224
request.client = None
225225
elif not request.client.is_usable(request):
226-
log.debug("request.client is a valid Application, but is not usable, resetting request.client.")
226+
log.debug("request.client is a valid Application, but is not usable, resetting request.client")
227227
request.client = None
228228
else:
229-
log.debug("request.client is a valid Application, reusing it.")
229+
log.debug("request.client is a valid Application, reusing it")
230230
return request.client
231231
try:
232232
# cache wasn't hit, load from db
@@ -235,8 +235,8 @@ def _load_application(self, client_id, request):
235235
if not client.is_usable(request):
236236
log.debug("Failed to load application: Application %r is not usable" % (client_id))
237237
return None
238-
log.debug("Loaded application %r from database", client)
239238
request.client = client
239+
log.debug("Loaded application %r from database", client)
240240
return request.client
241241
except Application.DoesNotExist:
242242
log.debug("Failed to load application: Application %r does not exist" % (client_id))

tests/test_authorization_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ def test_request_body_params(self):
13101310

13111311
def test_request_body_params_client_typo(self):
13121312
"""
1313-
Request an access token using client_type: public
1313+
Verify that using incorrect parameter name (client instead of client_id) returns invalid_client error
13141314
"""
13151315
self.client.login(username="test_user", password="123456")
13161316
authorization_code = self.get_auth()

0 commit comments

Comments
 (0)