Skip to content

Commit

Permalink
Find applications for client_id
Browse files Browse the repository at this point in the history
  • Loading branch information
janbaykara authored Jul 15, 2022
1 parent e588432 commit eef2ce4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/templatetags/setting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.translation import gettext_lazy as _
from oauth2_provider.models import Application

register = template.Library()

Expand Down Expand Up @@ -41,7 +42,7 @@ def oauth_application_from_query(context):
params = urllib.parse.parse_qs(url_parts.query)
client_id = params.get('client_id', None)
if client_id is not None and len(client_id) > 0:
app = OAuthApp.filter(client_id__in=client_id).first()
app = Application.objects.filter(client_id__in=client_id).first()
return app
except:
return None

0 comments on commit eef2ce4

Please sign in to comment.