From 378a3e84c6747a4979a6ba5a11bad08c350c0fbd Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Mon, 22 Jul 2024 19:03:03 +0000 Subject: [PATCH] add katsu rule changes --- bento_beacon/config_files/config.py | 1 + bento_beacon/utils/katsu_utils.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bento_beacon/config_files/config.py b/bento_beacon/config_files/config.py index baf6f3eb..8a6cf171 100644 --- a/bento_beacon/config_files/config.py +++ b/bento_beacon/config_files/config.py @@ -149,6 +149,7 @@ class Config: KATSU_SEARCH_OVERVIEW = "/api/search_overview" KATSU_PRIVATE_OVERVIEW = "/api/overview" KATSU_PUBLIC_OVERVIEW = "/api/public_overview" + KATSU_PUBLIC_RULES = "/api/public_rules" KATSU_TIMEOUT = int(os.environ.get("BEACON_KATSU_TIMEOUT", 180)) MAP_EXTRA_PROPERTIES_TO_INFO = os.environ.get("MAP_EXTRA_PROPERTIES_TO_INFO", True) diff --git a/bento_beacon/utils/katsu_utils.py b/bento_beacon/utils/katsu_utils.py index 341cc71a..a1294ba2 100644 --- a/bento_beacon/utils/katsu_utils.py +++ b/bento_beacon/utils/katsu_utils.py @@ -278,9 +278,10 @@ def overview_statistics(): def katsu_censorship_settings() -> tuple[int | None, int | None]: - overview = katsu_get(current_app.config["KATSU_PUBLIC_OVERVIEW"]) - max_filters = overview.get("max_query_parameters") - count_threshold = overview.get("count_threshold") + # TODO: should be project-dataset scoped + rules = katsu_get(current_app.config["KATSU_PUBLIC_RULES"]) + max_filters = rules.get("max_query_parameters") + count_threshold = rules.get("count_threshold") # return even if None return max_filters, count_threshold