From c6b1e910442e92521c343d273828977d777ed60a Mon Sep 17 00:00:00 2001 From: marekbiczysko Date: Mon, 4 Nov 2024 14:22:09 +0100 Subject: [PATCH 1/4] hotfix_disable_biometrics_schema_for_all_programs --- src/hct_mis_api/apps/program/schema.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hct_mis_api/apps/program/schema.py b/src/hct_mis_api/apps/program/schema.py index 2127c6070d..94199ea827 100644 --- a/src/hct_mis_api/apps/program/schema.py +++ b/src/hct_mis_api/apps/program/schema.py @@ -262,11 +262,17 @@ class Query(graphene.ObjectType): def resolve_can_run_deduplication(self, info: Any, **kwargs: Any) -> bool: encoded_program_id = info.context.headers.get("Program") + if encoded_program_id == "all": + return False + program = Program.objects.only("biometric_deduplication_enabled").get(id=decode_id_string(encoded_program_id)) return program.biometric_deduplication_enabled def resolve_is_deduplication_disabled(self, info: Any, **kwargs: Any) -> bool: encoded_program_id = info.context.headers.get("Program") + if encoded_program_id == "all": + return False + program = Program.objects.only("id").get(id=decode_id_string(encoded_program_id)) # deduplication engine in progress is_still_processing = RegistrationDataImport.objects.filter( From eda7d482d6fc5afad397f895302432840b18e18a Mon Sep 17 00:00:00 2001 From: marekbiczysko Date: Mon, 4 Nov 2024 14:23:34 +0100 Subject: [PATCH 2/4] hotfix_disable_biometrics_schema_for_all_programs --- src/hct_mis_api/apps/program/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hct_mis_api/apps/program/schema.py b/src/hct_mis_api/apps/program/schema.py index 94199ea827..65fae7da75 100644 --- a/src/hct_mis_api/apps/program/schema.py +++ b/src/hct_mis_api/apps/program/schema.py @@ -271,7 +271,7 @@ def resolve_can_run_deduplication(self, info: Any, **kwargs: Any) -> bool: def resolve_is_deduplication_disabled(self, info: Any, **kwargs: Any) -> bool: encoded_program_id = info.context.headers.get("Program") if encoded_program_id == "all": - return False + return True program = Program.objects.only("id").get(id=decode_id_string(encoded_program_id)) # deduplication engine in progress From b309a161b29d847a2c9cc336f5d8cce2249550d2 Mon Sep 17 00:00:00 2001 From: marekbiczysko Date: Mon, 4 Nov 2024 14:39:21 +0100 Subject: [PATCH 3/4] hotfix_disable_biometrics_schema_for_all_programs --- src/hct_mis_api/apps/program/schema.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hct_mis_api/apps/program/schema.py b/src/hct_mis_api/apps/program/schema.py index 65fae7da75..3d9eb08394 100644 --- a/src/hct_mis_api/apps/program/schema.py +++ b/src/hct_mis_api/apps/program/schema.py @@ -43,8 +43,8 @@ from hct_mis_api.apps.core.utils import ( chart_filters_decoder, chart_permission_decorator, - decode_id_string, to_choice_object, + get_program_id_from_headers, ) from hct_mis_api.apps.payment.filters import ( CashPlanFilter, @@ -261,19 +261,19 @@ class Query(graphene.ObjectType): is_deduplication_disabled = graphene.Boolean() def resolve_can_run_deduplication(self, info: Any, **kwargs: Any) -> bool: - encoded_program_id = info.context.headers.get("Program") - if encoded_program_id == "all": + program_id = get_program_id_from_headers(info.context.headers) + if not program_id: return False - program = Program.objects.only("biometric_deduplication_enabled").get(id=decode_id_string(encoded_program_id)) + program = Program.objects.only("biometric_deduplication_enabled").get(id=program_id) return program.biometric_deduplication_enabled def resolve_is_deduplication_disabled(self, info: Any, **kwargs: Any) -> bool: - encoded_program_id = info.context.headers.get("Program") - if encoded_program_id == "all": + program_id = get_program_id_from_headers(info.context.headers) + if not program_id: return True - program = Program.objects.only("id").get(id=decode_id_string(encoded_program_id)) + program = Program.objects.only("id").get(id=program_id) # deduplication engine in progress is_still_processing = RegistrationDataImport.objects.filter( program=program, From f8b95716ff7d82baee3902208d085ed5a9914e49 Mon Sep 17 00:00:00 2001 From: marekbiczysko Date: Tue, 5 Nov 2024 15:47:08 +0100 Subject: [PATCH 4/4] lint --- src/hct_mis_api/apps/program/schema.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hct_mis_api/apps/program/schema.py b/src/hct_mis_api/apps/program/schema.py index 3d9eb08394..16884aa4bb 100644 --- a/src/hct_mis_api/apps/program/schema.py +++ b/src/hct_mis_api/apps/program/schema.py @@ -43,8 +43,8 @@ from hct_mis_api.apps.core.utils import ( chart_filters_decoder, chart_permission_decorator, - to_choice_object, get_program_id_from_headers, + to_choice_object, ) from hct_mis_api.apps.payment.filters import ( CashPlanFilter,