Skip to content

Commit

Permalink
refactor(API): store query params app_platform & app_page in source f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
raphodn committed Dec 30, 2024
1 parent eee0b9c commit 889c806
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion open_prices/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def get_object_or_drf_404(model, **kwargs):
def get_source_from_request(request):
app_name = request.GET.get("app_name", "API")
app_version = request.GET.get("app_version", "")
app_platform = request.GET.get("app_platform", "")
app_page = request.GET.get("app_page", "")
if app_version:
return f"{app_name} ({app_version})"
app_name += f" ({app_version})"
if app_platform:
app_name += f" ({app_platform})"
if app_page:
app_name += f" - {app_page}"
return app_name

0 comments on commit 889c806

Please sign in to comment.