Skip to content

Commit

Permalink
fix slow csl app links issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev Srivastava authored and Dev Srivastava committed May 13, 2024
1 parent 3c76346 commit c033a9e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions intranet/apps/cslapps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ def redirect_to_app(request):
return response
return redirect(app.url)
else:
last_token = AccessToken.objects.filter(user=request.user, \
application=app.oauth_application). \
order_by("-expires"). \
values_list("token", "expires"). \
first()
last_token = (
AccessToken.objects.filter(user=request.user, application=app.oauth_application)
.order_by("-expires")
.values_list("token", "expires")
.first()
)
if last_token and last_token.is_valid():
return redirect(app.url)
return redirect(app.auth_url)
Expand Down

0 comments on commit c033a9e

Please sign in to comment.