Skip to content

Commit 15972f1

Browse files
authored
Merge pull request #3504 from stsewd/consistent-version-format
Consistent version format
2 parents 24a9a0c + 3250b32 commit 15972f1

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

readthedocs/core/static-src/core/js/doc-embed/version-compare.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function init(data) {
2323
warning
2424
.find('a')
2525
.attr('href', currentURL)
26-
.text(data.version);
26+
.text(data.slug);
2727

2828
var body = $("div.body");
2929
if (!body.length) {

readthedocs/restapi/views/footer_views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_version_compare_data(project, base_version=None):
4343
}
4444
if highest_version_obj:
4545
ret_val['url'] = highest_version_obj.get_absolute_url()
46-
ret_val['slug'] = (highest_version_obj.slug,)
46+
ret_val['slug'] = highest_version_obj.slug
4747
if base_version and base_version.slug != LATEST:
4848
try:
4949
base_version_comparable = parse_version_failsafe(

readthedocs/rtd_tests/tests/test_footer.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def test_highest_version_from_stable(self):
111111
valid_data = {
112112
'project': 'Version 0.8.1 of Pip (19)',
113113
'url': '/dashboard/pip/version/0.8.1/',
114-
'slug': ('0.8.1',),
114+
'slug': '0.8.1',
115115
'version': '0.8.1',
116116
'is_highest': True,
117117
}
@@ -123,7 +123,7 @@ def test_highest_version_from_lower(self):
123123
valid_data = {
124124
'project': 'Version 0.8.1 of Pip (19)',
125125
'url': '/dashboard/pip/version/0.8.1/',
126-
'slug': ('0.8.1',),
126+
'slug': '0.8.1',
127127
'version': '0.8.1',
128128
'is_highest': False,
129129
}
@@ -136,7 +136,7 @@ def test_highest_version_from_latest(self):
136136
valid_data = {
137137
'project': 'Version 0.8.1 of Pip (19)',
138138
'url': '/dashboard/pip/version/0.8.1/',
139-
'slug': ('0.8.1',),
139+
'slug': '0.8.1',
140140
'version': '0.8.1',
141141
'is_highest': True,
142142
}
@@ -164,7 +164,7 @@ def test_highest_version_over_branches(self):
164164
valid_data = {
165165
'project': 'Version 1.0.0 of Pip ({})'.format(version.pk),
166166
'url': '/dashboard/pip/version/1.0.0/',
167-
'slug': ('1.0.0',),
167+
'slug': '1.0.0',
168168
'version': '1.0.0',
169169
'is_highest': False,
170170
}
@@ -178,7 +178,7 @@ def test_highest_version_without_tags(self):
178178
valid_data = {
179179
'project': 'Version 0.8.1 of Pip (19)',
180180
'url': '/dashboard/pip/version/0.8.1/',
181-
'slug': ('0.8.1',),
181+
'slug': '0.8.1',
182182
'version': '0.8.1',
183183
'is_highest': True,
184184
}
@@ -189,7 +189,7 @@ def test_highest_version_without_tags(self):
189189
valid_data = {
190190
'project': 'Version 0.8.1 of Pip (19)',
191191
'url': '/dashboard/pip/version/0.8.1/',
192-
'slug': ('0.8.1',),
192+
'slug': '0.8.1',
193193
'version': '0.8.1',
194194
'is_highest': False,
195195
}
@@ -206,7 +206,7 @@ def test_highest_version_without_tags(self):
206206
valid_data = {
207207
'project': 'Version 2.0.0 of Pip ({})'.format(version.pk),
208208
'url': '/dashboard/pip/version/2.0.0/',
209-
'slug': ('2.0.0',),
209+
'slug': '2.0.0',
210210
'version': '2.0.0',
211211
'is_highest': False,
212212
}

0 commit comments

Comments
 (0)