Skip to content

Commit

Permalink
Upgrade gsheets to latest
Browse files Browse the repository at this point in the history
This may all be moot if we're forced to scrap the spreadsheet
functionality, but all the same -- upgrade and fix a typing error.
  • Loading branch information
DavidCain committed Jun 22, 2024
1 parent 2e4a00f commit f4e228c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
23 changes: 3 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions ws/utils/member_sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,18 @@ def update_participant(
last_col = len(writer.header)
for cell in wks.findall(participant.email):
if cell.col == 2: # (Participants _could_ name themselves an email...)
# pylint: disable=too-many-function-args
row_cells = wks.range(cell.row, 1, cell.row, last_col)
row_cells = wks.range( # pylint: disable=too-many-function-args
cell.row, 1, cell.row, last_col
)
_assign(row_cells, new_row)
wks.update_cells(row_cells)
return

# Insert a new row if no existing row found
sorted_names = wks.col_values(1)[1:]
# No existing row was found for the participant, so insert (maintaining sort)
sorted_names: list[str] = []
for name in wks.col_values(1)[1:]:
assert isinstance(name, str) # (not numeric, not null)
sorted_names.append(name)
row_index = bisect.bisect(sorted_names, participant.name) + 1
wks.insert_row(new_row, row_index + 1)

Expand Down

0 comments on commit f4e228c

Please sign in to comment.