Skip to content

Commit

Permalink
style: fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Mar 22, 2024
1 parent fff0c67 commit 4b02eb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions openedx/core/djangoapps/content/search/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def _get_meilisearch_client():
raise ConnectionError("Unable to connect to Meilisearch") from err
return _MEILI_CLIENT


def clear_meilisearch_client():
global _MEILI_CLIENT # pylint: disable=global-statement

Expand Down Expand Up @@ -224,6 +225,7 @@ def _recurse_children(block, fn, status_cb: Callable[[str], None] | None = None)
else:
fn(child)


def only_if_meilisearch_enabled(f):
"""
Only call `f` if meilisearch is enabled
Expand Down Expand Up @@ -317,8 +319,8 @@ def nop(_message):
)
docs = []

# Pre-fetch the course with all of its children:
course = store.get_course(course.id, depth=None)
# Pre-fetch the course with all of its children:
course = store.get_course(course.id, depth=None)

def add_with_children(block):
""" Recursively index the given XBlock/component """
Expand Down
5 changes: 3 additions & 2 deletions openedx/core/djangoapps/content/search/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,6 @@ def test_delete_index_xblock(self, mock_meilisearch):
"""
api.delete_xblock_index_doc(self.sequential.usage_key)

mock_meilisearch.return_value.index.return_value.delete_document.assert_called_once_with(self.doc_sequential['id'])

mock_meilisearch.return_value.index.return_value.delete_document.assert_called_once_with(
self.doc_sequential['id']
)

0 comments on commit 4b02eb3

Please sign in to comment.