Skip to content

Fix NULL counts for empty imprints/universes on publisher page - #601

Merged
bpepple merged 1 commit into
masterfrom
traceback
Aug 16, 2026
Merged

Fix NULL counts for empty imprints/universes on publisher page#601
bpepple merged 1 commit into
masterfrom
traceback

Conversation

@bpepple

@bpepple bpepple commented Aug 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Follow-up to Fix TemplateSyntaxError on publisher detail page #600, which annotated imprint.series_count/ universe.issue_count on the publisher detail page but still crashed in production on /publisher/dc-comics/
  • The correlated Subquery(Count(...)) annotation returns NULL (not 0) when an imprint has zero series or a universe has zero issues — DC Comics has several imprints/universes with nothing tagged to them yet (e.g. the amazonia universe)
  • {% blocktrans count counter=... %} still raised TemplateSyntaxError: 'counter' argument to 'blocktrans' tag must be a number for None, just as it did for the missing annotation in Fix TemplateSyntaxError on publisher detail page #600
  • Wraps both subqueries in Coalesce(..., 0) in PublisherDetail and the PublisherImprintsLoadMore/PublisherUniversesLoadMore HTMX endpoints

Coalesce the imprint series_count/universe issue_count subqueries to 0. A correlated Subquery returns NULL (not 0) when an imprint has no series or a universe has no issues, which still tripped the blocktrans counter TemplateSyntaxError the prior fix in #600 didn't cover (e.g. dc-comics, which has several empty imprints/universes).
@bpepple bpepple self-assigned this Aug 16, 2026
@bpepple bpepple added the bug Something isn't working label Aug 16, 2026
@bpepple
bpepple merged commit 9ff3395 into master Aug 16, 2026
2 checks passed
@bpepple
bpepple deleted the traceback branch August 16, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant