Minor Python fixes identified by SonarQube.

1. Remove return from EmptySearchResults.__init__. Init method is
required to return None.
2. Remove useless self-assignment from BaseSearchBackend.
3. Remove useless self-assignment from wagtail.tests.settings.
This commit is contained in:
Coen van der Kamp 2018-12-23 22:05:18 +01:00 committed by Andy Chosak
parent 8afbc6c3ec
commit 5e5484d4d7
2 changed files with 1 additions and 3 deletions

View file

@ -260,7 +260,7 @@ class BaseSearchResults:
class EmptySearchResults(BaseSearchResults):
def __init__(self):
return super().__init__(None, None)
super().__init__(None, None)
def _clone(self):
return self.__class__()
@ -350,7 +350,6 @@ class BaseSearchBackend:
return EmptySearchResults()
# Search
query_compiler_class = query_compiler_class
search_query = query_compiler_class(
queryset, query, **kwargs
)

View file

@ -41,7 +41,6 @@ SECRET_KEY = 'not needed'
ROOT_URLCONF = 'wagtail.tests.urls'
STATIC_URL = '/static/'
STATIC_ROOT = STATIC_ROOT
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.AppDirectoriesFinder',