Skip to content

Commit cb6ee05

Browse files
authored
Merge branch 'master' into session_management
2 parents 5b77eeb + d862f53 commit cb6ee05

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.6
3+
rev: v0.12.1
44
hooks:
55
- id: ruff
66
args: [ --fix ]

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,4 @@ Yaroslav Halchenko
124124
Yuri Savin
125125
Miriam Forner
126126
Alex Kerkum
127+
q0w

oauth2_provider/oauth2_validators.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ def invalidate_authorization_code(self, client_id, code, request, *args, **kwarg
322322
323323
:raises: InvalidGrantError if the grant does not exist.
324324
"""
325-
try:
326-
grant = Grant.objects.get(code=code, application=request.client)
327-
grant.delete()
328-
except Grant.DoesNotExist:
325+
deleted_grant_count, _ = Grant.objects.filter(code=code, application=request.client).delete()
326+
if not deleted_grant_count:
329327
raise errors.InvalidGrantError(request=request)
330328

331329
def validate_client_id(self, client_id, request, *args, **kwargs):

0 commit comments

Comments
 (0)