diff --git a/participation/models.py b/participation/models.py index 07a0636..107aabb 100644 --- a/participation/models.py +++ b/participation/models.py @@ -1269,13 +1269,9 @@ class Pool(models.Model): max_row = average_cell.row - 1 juries_visible = worksheet.get(f"A{min_row}:B{max_row}") juries_visible = [t for t in juries_visible if t and len(t) == 2] - rows_to_delete = [] - for i, (_jury_name, jury_id) in enumerate(juries_visible): + for i, (jury_name, jury_id) in enumerate(juries_visible): if not jury_id.isnumeric() or int(jury_id) not in self.juries.values_list("id", flat=True): - rows_to_delete.append(min_row + i) - for row_to_delete in rows_to_delete: - worksheet.delete_rows(row_to_delete) - max_row -= len(rows_to_delete) + print(f"Warning: {jury_name} ({jury_id}) appears on the sheet but is not part of the jury.") for jury in self.juries.all(): if str(jury.id) not in list(map(lambda x: x[1], juries_visible)):