Skip to content

Commit

Permalink
fix get or created
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Sep 28, 2024
1 parent f36919b commit 5679091
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions breathecode/authenticate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2108,20 +2108,15 @@ async def save_google_token(request):

logger.debug(body)

logger.info("aaaaaaaaaaaaaaaaaaaaaaaaa")
logger.info(body)
print("aaaaaaaaaaaaaaaaaaaaaaaaa")
print(body)

user = token.user
refresh = ""
if "refresh_token" in body:
refresh = body["refresh_token"]

google_credentials, created = await CredentialsGoogle.objects.aget_or_create(
user=user,
expires_at=timezone.now() + timedelta(seconds=body["expires_in"]),
defaults={
"expires_at": timezone.now() + timedelta(seconds=body["expires_in"]),
"token": body["access_token"],
"refresh_token": refresh,
},
Expand Down

0 comments on commit 5679091

Please sign in to comment.