Skip to content

Commit 6681b0f

Browse files
CM Lubinskiagjohnson
CM Lubinski
authored andcommitted
Don't replace section variable.
This worked as intended, but only because the overridden section variable would later evaluate to True. Using a different variable name makes this a bit less error-prone.
1 parent 48168e7 commit 6681b0f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

readthedocs/restapi/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,18 @@ def index_search_request(version, page_list, commit, project_scale, page_scale,
128128
'weight': page_scale + project_scale,
129129
})
130130
if section:
131-
for section in page['sections']:
131+
for sect in page['sections']:
132132
section_index_list.append({
133133
'id': (hashlib
134134
.md5('-'.join([project.slug, version.slug,
135-
page['path'], section['id']]))
135+
page['path'], sect['id']]))
136136
.hexdigest()),
137137
'project': project.slug,
138138
'version': version.slug,
139139
'path': page['path'],
140-
'page_id': section['id'],
141-
'title': section['title'],
142-
'content': section['content'],
140+
'page_id': sect['id'],
141+
'title': sect['title'],
142+
'content': sect['content'],
143143
'weight': page_scale,
144144
})
145145
for route in routes:

0 commit comments

Comments
 (0)