Skip to content

Don't let an empty submissions cell make get_course_users return None#70

Open
cyrus- wants to merge 1 commit into
nyuoss:mainfrom
cyrus-:fix/roster-empty-submissions
Open

Don't let an empty submissions cell make get_course_users return None#70
cyrus- wants to merge 1 commit into
nyuoss:mainfrom
cyrus-:fix/roster-empty-submissions

Conversation

@cyrus-

@cyrus- cyrus- commented Jun 8, 2026

Copy link
Copy Markdown

get_course_members assumes the "# submissions" column is 3rd-from-last (num_submissions_column = max(len(headers) - 3, 3)). On rosters with extra trailing action columns that index lands on an empty cell, so int(cells[...].text) raises ValueError — which get_course_users() catches and turns into a None return, i.e. the entire roster silently fails to load.

Guard the int() parse (default to 0 on ValueError/IndexError) so the roster — names, emails, roles, ids — still loads. Adds credential-free unit tests for the empty-cell and numeric-cell cases.

get_course_members assumes the "# submissions" column is 3rd-from-last
(num_submissions_column = max(len(headers) - 3, 3)). On rosters with extra
trailing action columns that index lands on an empty cell, so
int(cells[...].text) raises ValueError — which get_course_users() catches and
turns into a None return, i.e. the entire roster silently fails to load.

Guard the int() parse (default to 0 on ValueError/IndexError) so the roster —
names, emails, roles, ids — still loads. Adds credential-free unit tests for
the empty-cell and numeric-cell cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant