Add section for campaigns missing DropCampaignDetails in debug view
This commit is contained in:
parent
34c7d80b88
commit
3c0faf8470
2 changed files with 28 additions and 0 deletions
|
|
@ -157,4 +157,22 @@
|
||||||
<p>None ✅</p>
|
<p>None ✅</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2 id="missing-details-campaigns-header">
|
||||||
|
Campaigns Missing DropCampaignDetails ({{ campaigns_missing_dropcampaigndetails|length }})
|
||||||
|
</h2>
|
||||||
|
{% if campaigns_missing_dropcampaigndetails %}
|
||||||
|
<ul id="missing-details-campaigns-list">
|
||||||
|
{% for c in campaigns_missing_dropcampaigndetails %}
|
||||||
|
<li id="campaign-{{ c.twitch_id }}">
|
||||||
|
<a href="{% url 'twitch:campaign_detail' c.twitch_id %}">{{ c.name }}</a>
|
||||||
|
(Game: <a href="{% url 'twitch:game_detail' c.game.twitch_id %}">{{ c.game.display_name }}</a>)
|
||||||
|
- Operations: {{ c.operation_names|join:", "|default:'(none)' }}
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p>None ✅</p>
|
||||||
|
{% endif %}
|
||||||
|
</section>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
||||||
|
|
@ -962,6 +962,15 @@ def debug_view(request: HttpRequest) -> HttpResponse:
|
||||||
{"trimmed_op": op_name, "count": count} for op_name, count in sorted(operation_names_counter.items())
|
{"trimmed_op": op_name, "count": count} for op_name, count in sorted(operation_names_counter.items())
|
||||||
]
|
]
|
||||||
|
|
||||||
|
campaigns_missing_dropcampaigndetails: QuerySet[DropCampaign] = (
|
||||||
|
DropCampaign.objects
|
||||||
|
.filter(
|
||||||
|
Q(operation_names__isnull=True) | ~Q(operation_names__icontains="DropCampaignDetails"),
|
||||||
|
)
|
||||||
|
.select_related("game")
|
||||||
|
.order_by("game__display_name", "name")
|
||||||
|
)
|
||||||
|
|
||||||
context: dict[str, Any] = {
|
context: dict[str, Any] = {
|
||||||
"now": now,
|
"now": now,
|
||||||
"games_without_owner": games_without_owner,
|
"games_without_owner": games_without_owner,
|
||||||
|
|
@ -972,6 +981,7 @@ def debug_view(request: HttpRequest) -> HttpResponse:
|
||||||
"duplicate_name_campaigns": duplicate_name_campaigns,
|
"duplicate_name_campaigns": duplicate_name_campaigns,
|
||||||
"active_missing_image": active_missing_image,
|
"active_missing_image": active_missing_image,
|
||||||
"operation_names_with_counts": operation_names_with_counts,
|
"operation_names_with_counts": operation_names_with_counts,
|
||||||
|
"campaigns_missing_dropcampaigndetails": campaigns_missing_dropcampaigndetails,
|
||||||
}
|
}
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue