Some students can not see their grades
Bug #484485 reported by
Jeffrey Elkner
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SchoolTool Gradebook |
Fix Released
|
Medium
|
Douglas Cerna |
Bug Description
About 1/3 of my students got an error when they clicked on Gradebook after logging in to SchoolTool this afternoon. replaceafill hacked a solution, but wanted me to file this bug anyway. He will add details of what he found.
affects: | schooltool → schooltool.gradebook |
Changed in schooltool.gradebook: | |
assignee: | nobody → Alan Elkner (aelkner) |
Changed in schooltool.gradebook: | |
status: | New → Fix Committed |
Changed in schooltool.gradebook: | |
milestone: | none → 0.6.1 |
Changed in schooltool.gradebook: | |
importance: | Undecided → Medium |
Changed in schooltool.gradebook: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
jelkner's instance for some unexplained reason, has sections with no courses associated. I'll try to find out how this happened.
When the student logins and then hit the "Gradebook" tab, some methods like getSections, getCurrentSection and handleTermChange in schooltool/ gradebook/ browser/ gradebook. py try to convert the section.courses relationship to a list and then access the [0] element to get the course title:
>>> list(section. courses) [0].title
I learned from Ignas that since sections theorically could have several courses associated, you should do something like:
>>> ", ".join( [course. title for course in section.courses])
I don't know if it's the solution but it avoids the IndexError. If there is no courses associated, you get nothing as the course title and I can live with that. I'm sending a patch here. The fix for the handleTermChange method should be revised though (that's the only part I'd call a 'hack').