Skip to content

Fix get_grades() when EduPage sends udalostid as a number - #135

Open
pozi007 wants to merge 1 commit into
EdupageAPI:masterfrom
pozi007:fix-udalostid-int
Open

pozi007 wants to merge 1 commit into
EdupageAPI:masterfrom
pozi007:fix-udalostid-int

Conversation

@pozi007

@pozi007 pozi007 commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #134.

EduPage now returns vsetkyZnamky[].udalostid as a number, while the keys of vsetkyUdalosti["edupage"] are still strings. get_grades() therefore found no event details and raised AttributeError: 'NoneType' object has no attribute 'get' on every call.

Changes in get_grades():

Tests: two new cases in tests/test_grades.py (numeric udalostid, grade without event details). Both fail on current master and pass with this change; the full suite passes (50 tests). Also checked against live data from a parent account (two students): all grades load again.

EduPage now sends vsetkyZnamky[].udalostid as a number, while the keys
of vsetkyUdalosti["edupage"] are strings, so every lookup returned None
and get_grades() raised AttributeError. Cast the id to str before the
lookup, and skip a grade whose event details are missing instead of
failing the whole call.

Fixes EdupageAPI#134

This branch has not been deployed

No deployments
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.

[Bug] get_grades() crashes since EduPage sends udalostid as a number

1 participant