Fix 500: avoid dict lookup as default filter argument
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Django raises VariableDoesNotExist when a failed dict lookup is used as a
filter argument (|default:mineral.properties_ru.X). Rewrite color description
to use an {% if %} block so the dict lookup is always the main variable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 09:05:22 +03:00
parent 0a3248daa4
commit 959f0aa9d7

View File

@@ -534,7 +534,9 @@
<div class="color-swatch"></div>
<div class="color-info">
<span class="lang-en">{{ mineral.color_description|default:"Typical color" }}</span>
<span class="lang-ru">{{ mineral.color_description_ru|default:mineral.properties_ru.color_description|default:mineral.color_description|default:"Типичный цвет" }}</span>
<span class="lang-ru">
{% if mineral.color_description_ru %}{{ mineral.color_description_ru }}{% else %}{{ mineral.properties_ru.color_description|default:mineral.color_description|default:"Типичный цвет" }}{% endif %}
</span>
<br><span class="hex">{{ mineral.color_hex }}</span>
</div>
</div>