From 52acd9e1f151626e0f88a1287ec807bc40aae9ae Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Thu, 28 May 2026 21:57:57 +0200 Subject: [PATCH] style: use prefetched queryset length in card_gallery template --- plants/templates/plants/partials/card_gallery.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plants/templates/plants/partials/card_gallery.html b/plants/templates/plants/partials/card_gallery.html index 585d5b8..940f912 100644 --- a/plants/templates/plants/partials/card_gallery.html +++ b/plants/templates/plants/partials/card_gallery.html @@ -19,9 +19,8 @@ {% endfor %} {% endif %} - {% endwith %} - {% if plant.card_photos.count < 3 %} + {% if card_photos|length < 3 %}
@@ -32,6 +31,7 @@
- {% endif %} Up to 3 photos — front & back of the label + {% endif %} + {% endwith %}