Skip to content

Commit

Permalink
Append data to patched_figure_ids
Browse files Browse the repository at this point in the history
- Additionally log bulk update summary
  • Loading branch information
tnagorra committed Jun 4, 2024
1 parent 1ffec47 commit cd88c9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/entry/management/commands/fix_ahhs_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def patch_figure_household_from_csv(self, file_path):
),
),
)
bulk_mgr.done()
patched_figure_ids.append(row['figure_id'])
bulk_mgr.done()

if figure_id_not_found:
self.stdout.write(self.style.ERROR(f"Figure id not found ids: {figure_id_not_found}"))
Expand All @@ -74,8 +75,9 @@ def patch_figure_household_from_csv(self, file_path):
if no_change_in_household_figures:
logger.info(f"No change in household size figure ids: {no_change_in_household_figures}")

self.stdout.write(f"Total number of figures patched: {len(patched_figure_ids)}")
self.stdout.write(self.style.SUCCESS(f'Bulk update summary: {bulk_mgr.summary()}'))
self.stdout.write(f"IDs of figures patched: {patched_figure_ids}")
raise "hehe"

@transaction.atomic()
def handle(self, *args, **kwargs):
Expand Down

0 comments on commit cd88c9c

Please sign in to comment.