Skip to content

Commit f645f14

Browse files
committed
Use build.version_name first, in case build.version is None
When versions are removed, the builds remain with a `build.version = None`, along with some additional attributes on the Build instance (for example `build.version_name`). This bug affected any display that listed projects/versions that listed the most recent build. Fixes readthedocs/readthedocs.org#11061
1 parent abc8987 commit f645f14

File tree

1 file changed

+2
-2
lines changed
  • readthedocsext/theme/templates/includes/elements/chips

1 file changed

+2
-2
lines changed

readthedocsext/theme/templates/includes/elements/chips/build.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
{% block chip_text %}
1616
{# Allow for override of the text for version listing, where version is already stated #}
17-
{{ text|default:build.version.verbose_name }}
17+
{% firstof text build.version_name build.version.verbose_name %}
1818
{% endblock chip_text %}
1919

2020
{% block chip_detail_text %}
2121
#{{ build.id }}
2222
{% endblock chip_detail_text %}
2323

2424
{% block popupcard_header %}
25-
{{ text|default:build.version.verbose_name }} #{{ build.id }}
25+
{% firstof text build.version_name build.version.verbose_name %} #{{ build.id }}
2626
{% endblock popupcard_header %}
2727

2828
{% block popupcard_right %}

0 commit comments

Comments
 (0)