Skip to content

Commit dd7aff9

Browse files
author
Hamish Downer
committed
Pass already_selected from CLI through SelectionData
so we will actually generated the dupes
1 parent 4d58a57 commit dd7aff9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/sortition_algorithms/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ def csv(
137137
people_selected_rows=selected_rows,
138138
people_remaining_rows=remaining_rows,
139139
settings=settings_obj,
140+
already_selected=already_selected,
140141
)
141142

142143

@@ -252,6 +253,7 @@ def gsheet(
252253
people_selected_rows=selected_rows,
253254
people_remaining_rows=remaining_rows,
254255
settings=settings_obj,
256+
already_selected=already_selected,
255257
)
256258

257259

src/sortition_algorithms/adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def output_selected_remaining(
219219
people_selected_rows: list[list[str]],
220220
people_remaining_rows: list[list[str]],
221221
settings: Settings,
222+
already_selected: People | None = None,
222223
) -> tuple[list[int], RunReport]:
223224
report = RunReport()
224225
self.data_source.write_selected(people_selected_rows, report)
@@ -227,7 +228,7 @@ def output_selected_remaining(
227228
return [], report
228229
self.data_source.write_remaining(people_remaining_rows, report)
229230
# TODO: also highlight dupes of address in selected tab/set
230-
dupes = generate_dupes(people_remaining_rows, people_selected_rows, settings)
231+
dupes = generate_dupes(people_remaining_rows, people_selected_rows, settings, already_selected=already_selected)
231232
self.data_source.highlight_dupes(dupes)
232233
report.add_line_and_log("Finished writing both selected and remaining", logging.INFO)
233234
return dupes, report

0 commit comments

Comments
 (0)