Skip to content

Commit 846ab0b

Browse files
egegunesauvipy
authored andcommitted
Fix not supported FOR UPDATE query for Postgresql, fixes #714 (#715)
1 parent 2fdb0fe commit 846ab0b

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,14 @@ def _get_token_from_authentication_server(
332332
scope = content.get("scope", "")
333333
expires = make_aware(expires)
334334

335-
access_token, _created = AccessToken\
336-
.objects.select_related("application", "user")\
337-
.update_or_create(token=token,
338-
defaults={
339-
"user": user,
340-
"application": None,
341-
"scope": scope,
342-
"expires": expires,
343-
})
335+
access_token, _created = AccessToken.objects.update_or_create(
336+
token=token,
337+
defaults={
338+
"user": user,
339+
"application": None,
340+
"scope": scope,
341+
"expires": expires,
342+
})
344343

345344
return access_token
346345

0 commit comments

Comments
 (0)