From 0322744104a7a521db8516966ee631df2373b968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Wed, 3 Sep 2025 17:23:59 +0200 Subject: [PATCH] Add organization data serialization to OrgDetailView --- templates/twitch/organization_detail.html | 1 + twitch/views.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/templates/twitch/organization_detail.html b/templates/twitch/organization_detail.html index cc7723f..70693df 100644 --- a/templates/twitch/organization_detail.html +++ b/templates/twitch/organization_detail.html @@ -34,4 +34,5 @@ {% endfor %} +
{{ org_data }}
{% endblock content %} diff --git a/twitch/views.py b/twitch/views.py index eb91885..9293a5d 100644 --- a/twitch/views.py +++ b/twitch/views.py @@ -63,9 +63,18 @@ class OrgDetailView(DetailView): games: QuerySet[Game, Game] = organization.games.all() # pyright: ignore[reportAttributeAccessIssue] + serialized_org = serialize( + "json", + [organization], + fields=("name",), + ) + org_data = json.loads(serialized_org) + pretty_org_data = json.dumps(org_data[0], indent=4) + context.update({ "subscription": subscription, "games": games, + "org_data": pretty_org_data, }) return context