Skip to content

Commit

Permalink
Fix not supported FOR UPDATE query for Postgresql, fixes #714 (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
egegunes authored and Asif Saif Uddin committed May 9, 2019
1 parent 2fdb0fe commit 846ab0b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions oauth2_provider/oauth2_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,14 @@ def _get_token_from_authentication_server(
scope = content.get("scope", "")
expires = make_aware(expires)

access_token, _created = AccessToken\
.objects.select_related("application", "user")\
.update_or_create(token=token,
defaults={
"user": user,
"application": None,
"scope": scope,
"expires": expires,
})
access_token, _created = AccessToken.objects.update_or_create(
token=token,
defaults={
"user": user,
"application": None,
"scope": scope,
"expires": expires,
})

return access_token

Expand Down

0 comments on commit 846ab0b

Please sign in to comment.