Skip to content

Commit

Permalink
Merge branch 'hotfix_disable_biometrics_schema_for_all_programs' into…
Browse files Browse the repository at this point in the history
… fix/220846-Access-denied-and-gray-page-on-access-household-through-rdi
  • Loading branch information
domdinicola committed Nov 5, 2024
2 parents 7871c91 + f8b9571 commit c9a2fe8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/hct_mis_api/apps/program/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
from hct_mis_api.apps.core.utils import (
chart_filters_decoder,
chart_permission_decorator,
decode_id_string,
get_program_id_from_headers,
to_choice_object,
)
from hct_mis_api.apps.payment.filters import (
Expand Down Expand Up @@ -261,13 +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")
program = Program.objects.only("biometric_deduplication_enabled").get(id=decode_id_string(encoded_program_id))
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=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")
program = Program.objects.only("id").get(id=decode_id_string(encoded_program_id))
program_id = get_program_id_from_headers(info.context.headers)
if not program_id:
return True

program = Program.objects.only("id").get(id=program_id)
# deduplication engine in progress
is_still_processing = RegistrationDataImport.objects.filter(
program=program,
Expand Down

0 comments on commit c9a2fe8

Please sign in to comment.