Skip to content

Commit c2f604d

Browse files
committed
lint fix
1 parent f730556 commit c2f604d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

readthedocs/projects/tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -945,22 +945,22 @@ def _manage_imported_files(version, path, commit):
945945
for root, __, filenames in os.walk(path):
946946
for filename in filenames:
947947
if fnmatch.fnmatch(filename, '*.html'):
948-
model_class = HTMLFile
948+
model_class_ = HTMLFile
949949
else:
950-
model_class = ImportedFile
950+
model_class_ = ImportedFile
951951

952952
dirpath = os.path.join(root.replace(path, '').lstrip('/'),
953953
filename.lstrip('/'))
954954
full_path = os.path.join(root, filename)
955955
md5 = hashlib.md5(open(full_path, 'rb').read()).hexdigest()
956956
try:
957-
obj, __ = model_class.objects.get_or_create(
957+
obj, __ = model_class_.objects.get_or_create(
958958
project=version.project,
959959
version=version,
960960
path=dirpath,
961961
name=filename,
962962
)
963-
except model_class.MultipleObjectsReturned:
963+
except model_class_.MultipleObjectsReturned:
964964
log.warning('Error creating ImportedFile')
965965
continue
966966
if obj.md5 != md5:

readthedocs/search/documents.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ def get_queryset(self):
9090
.exclude(name__in=SEARCH_EXCLUDED_FILE))
9191
return queryset
9292

93-
def update(self, thing, **kwargs):
93+
def update(self, thing, *args, **kwargs):
9494
"""Overwrite in order to index only certain files"""
95-
9695
# Object not exist in the provided queryset should not be indexed
9796
# TODO: remove this overwrite when the issue has been fixed
9897
# See below link for more information
@@ -104,4 +103,4 @@ def update(self, thing, **kwargs):
104103
if not obj.exists():
105104
return None
106105

107-
return super(PageDocument, self).update(thing=thing, **kwargs)
106+
return super(PageDocument, self).update(thing=thing, *args, **kwargs)

readthedocs/search/faceted_search.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33

44
class RTDFacetedSearch(FacetedSearch):
5-
"""Overwrite the initialization in order too meet our needs"""
5+
"""
6+
Overwrite the initialization in order too meet our needs
7+
"""
68

79
# TODO: Remove the overwrite when the elastic/elasticsearch-dsl-py#916
810
# See more: https://github.com/elastic/elasticsearch-dsl-py/issues/916

0 commit comments

Comments
 (0)