Skip to content

Commit

Permalink
AB#220846 Access denied and gray page on access household through rdi
Browse files Browse the repository at this point in the history
  • Loading branch information
johniak committed Nov 5, 2024
1 parent 987532c commit 3836afb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function RegistrationDetails({
const { t } = useTranslation();
const { data } = useRegistrationDataImportQuery({
variables: {
id: btoa(`RegistrationDataImportNode:${hctId}`),
id: hctId,
},
});
if (!data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(
super().__init__()

def _handle_image_field(self, value: Any, is_flex_field: bool) -> Optional[Union[str, File]]:
logger.info(f"Processing image field: {value}")
if not self.registration_data_import.pull_pictures:
return None
if self.attachments is None:
Expand All @@ -101,6 +102,7 @@ def _handle_image_field(self, value: Any, is_flex_field: bool) -> Optional[Union
file = File(image_bytes, name=value)
if is_flex_field:
return default_storage.save(value, file)
logger.info(f"Image field processed: {value}")
return file

def _handle_geopoint_field(self, value: Any, is_flex_field: bool) -> Point:
Expand Down Expand Up @@ -220,7 +222,11 @@ def execute(
collectors_to_create = defaultdict(list)
household_hash_list = []
household_batch_size = 50
logger.info(f"Processing {len(self.reduced_submissions)} households")
chunk_index = 0
for reduced_submission_chunk in chunks(self.reduced_submissions, household_batch_size):
chunk_index += 1
logger.info(f"Processing chunk {chunk_index}/{len(self.reduced_submissions) // household_batch_size}")
for household in reduced_submission_chunk:
# AB#199540
household_hash = calculate_hash_for_kobo_submission(household)
Expand Down

0 comments on commit 3836afb

Please sign in to comment.