Skip to content

Commit 967776a

Browse files
committed
Address suggestions from code review in #8237
1 parent 65ddf48 commit 967776a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

readthedocs/api/v2/templates/restapi/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<dt>{% trans "Versions" %}</dt>
4343
{% for version in versions %}
4444
<dd {% if version == current_version %} class="rtd-current-item" {% endif %}>
45-
<a href="{{ version.get_subdomain_url }}{{ path|default_if_none:"" }}">{{ version.explicit_name }}</a>
45+
<a href="{{ version.get_subdomain_url }}{{ path|default_if_none:"" }}">{{ version.verbose_name }}</a>
4646
</dd>
4747
{% endfor %}
4848
</dl>

readthedocs/builds/models.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,16 @@ def explicit_name(self):
206206
For example, if a version originates from GitHub pull request #4, then
207207
``version.explicit_name == "#4 (PR)"``.
208208
209-
On the other hand, Versions associated with regular ReadTheDocs builds
209+
On the other hand, Versions associated with regular RTD builds
210210
(e.g. new tags or branches), simply return :obj:`~.verbose_name`.
211211
This means that a regular git tag named **v4** will correspond to
212212
``version.explicit_name == "v4"``.
213213
"""
214-
external_origin = external_version_name(self)
215-
216-
if not external_origin:
214+
if not self.is_external:
217215
return self.verbose_name
218216

219217
template = '#{name} ({abbrev})'
218+
external_origin = external_version_name(self)
220219
abbrev = ''.join(word[0].upper() for word in external_origin.split())
221220
return template.format(name=self.verbose_name, abbrev=abbrev)
222221

0 commit comments

Comments
 (0)