Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix_disable_biometrics_schema_for_all_programs #4400

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading