From 4a93b6888a537fd10c67ffdcc9d299603888ef4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Wed, 20 Mar 2024 22:11:34 -0300 Subject: [PATCH] feat: create decorator? --- openedx/core/djangoapps/content/search/api.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openedx/core/djangoapps/content/search/api.py b/openedx/core/djangoapps/content/search/api.py index 46eb96a2399a..13bec3e88a41 100644 --- a/openedx/core/djangoapps/content/search/api.py +++ b/openedx/core/djangoapps/content/search/api.py @@ -218,6 +218,18 @@ def _recurse_children(block, fn, status_cb: Callable[[str], None] | None = None) else: fn(child) +# ToDo: create a decorator?? +# def if_search_enabled(f): +# """ +# Only call `f` if meilisearch is enabled +# """ +# @wraps(f) +# def wrapper(*args, **kwargs): +# """Wraps the decorated function.""" +# if is_meilisearch_enabled(): +# return f(*args, **kwargs) +# return wrapper + def is_meilisearch_enabled() -> bool: """