seanpedrickcase commited on
Commit
3946be6
·
1 Parent(s): f47b137

Minor update to ensure whole page redactions are applied correctly to a document with existing redactions

Browse files
Files changed (1) hide show
  1. tools/find_duplicate_pages.py +2 -3
tools/find_duplicate_pages.py CHANGED
@@ -543,15 +543,14 @@ def apply_whole_page_redactions_from_list(duplicate_page_numbers_df:pd.DataFrame
543
 
544
  if current_page_existing_boxes_group:
545
  # Check if we already have a whole page redaction for this page
546
- if not any(box.get("label", "Whole page") for box in current_page_existing_boxes_group["boxes"]):
547
  current_page_existing_boxes_group["boxes"].append(annotation_box)
548
 
549
  else:
550
  # Optional: Print a message if a whole-page redaction already exists for this page
551
  print(f"Whole page redaction for page {page} already exists in annotations, skipping addition.")
552
  pass
553
- else:
554
- # Create new annotation entry
555
 
556
  all_annotations.append(new_annotation_group)
557
 
 
543
 
544
  if current_page_existing_boxes_group:
545
  # Check if we already have a whole page redaction for this page
546
+ if not any(box["label"] == "Whole page" for box in current_page_existing_boxes_group["boxes"]):
547
  current_page_existing_boxes_group["boxes"].append(annotation_box)
548
 
549
  else:
550
  # Optional: Print a message if a whole-page redaction already exists for this page
551
  print(f"Whole page redaction for page {page} already exists in annotations, skipping addition.")
552
  pass
553
+ else: # Create new annotation entry
 
554
 
555
  all_annotations.append(new_annotation_group)
556