Skip to content

Commit

Permalink
Fix query param parser
Browse files Browse the repository at this point in the history
  • Loading branch information
janbaykara authored Jul 15, 2022
1 parent 51957fc commit 77e5305
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions app/templatetags/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,11 @@ def user_data(context):
def oauth_application_from_query(context):
try:
request = context["request"]
print("request.GET", request.GET)
next = request.GET.get('next', None)
print("next", next)
if next is not None:
next_url_parts = urllib.parse.urlparse(next)
print("next_url_parts", next_url_parts)
print("next_url_parts.query", next_url_parts.query)
client_id = next_url_parts.query.get('client_id', None)
url_parts = urllib.parse.urlparse(next)
params = urllib.parse.parse_qs(url_parts.query)
client_id = params.get('client_id', None)
if client_id is not None:
app = OAuthApp.filter(client_id=client_id).first()
return app
Expand Down

0 comments on commit 77e5305

Please sign in to comment.