Skip to content

Commit

Permalink
Correctly filter on client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
janbaykara authored Jul 15, 2022
1 parent 2fb5808 commit e588432
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/templatetags/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,10 @@ def oauth_application_from_query(context):
next = request.GET.get('next', None)
if next is not None:
url_parts = urllib.parse.urlparse(next)
print("url_parts", url_parts)
params = urllib.parse.parse_qs(url_parts.query)
print("params", params)
client_id = params.get('client_id', None)
print("client_id", client_id)
if client_id is not None:
app = OAuthApp.filter(client_id=client_id).first()
if client_id is not None and len(client_id) > 0:
app = OAuthApp.filter(client_id__in=client_id).first()
return app
except:
return None

0 comments on commit e588432

Please sign in to comment.