From f2f6ebead1129741a5243f18dbd7c4c1cbbaf749 Mon Sep 17 00:00:00 2001 From: JunhaoQiu <56094690+qchiujunhao@users.noreply.github.com> Date: Sun, 31 Dec 2023 18:34:45 -0500 Subject: [PATCH 1/3] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8852cb598..b887b4652 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3.8 + python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 From 5698bca1743dc70ea163b2d55f8850520e86af35 Mon Sep 17 00:00:00 2001 From: JunhaoQiu <56094690+qchiujunhao@users.noreply.github.com> Date: Sun, 31 Dec 2023 18:34:58 -0500 Subject: [PATCH 2/3] filter out un-searchable rows --- common/helpers/db.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/helpers/db.py b/common/helpers/db.py index 22ecfd433..59c7d7955 100644 --- a/common/helpers/db.py +++ b/common/helpers/db.py @@ -7,7 +7,7 @@ def db_table_exists(table_name): # Check to see if democracylab's database tables have been initialized yet def db_is_initialized(): - return db_table_exists('common_tag') + return db_table_exists("common_tag") def bulk_delete(Table, delete_results): @@ -16,5 +16,8 @@ def bulk_delete(Table, delete_results): def unique_column_values(model, column, filter_func): - values = map(lambda obj_property: obj_property[column], model.objects.values(column).distinct()) - return list(filter(filter_func, values)) \ No newline at end of file + values = map( + lambda obj_property: obj_property[column], + model.objects.filter(is_searchable=True).values(column).distinct(), + ) + return list(filter(filter_func, values)) From ed272f3372f2c808a5f6b2ee332bf7bc50b93832 Mon Sep 17 00:00:00 2001 From: JunhaoQiu <56094690+qchiujunhao@users.noreply.github.com> Date: Sun, 31 Dec 2023 18:35:16 -0500 Subject: [PATCH 3/3] Revert "Update .pre-commit-config.yaml" This reverts commit f2f6ebead1129741a5243f18dbd7c4c1cbbaf749. --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b887b4652..8852cb598 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: python3 + python: python3.8 repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0