Terms cannot be titled "First" or "Last"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SchoolTool |
Fix Released
|
Low
|
Alan Elkner |
Bug Description
I just noticed that you cannot titled a Term "First" or "Last" (learned in the wrong way!). If you do that you get a traversal error about "mediumDate". I guess it's related to this expression in schooltool/
<tal:block tal:content=
"context" here is a SchoolYear. SchoolYears have "first" and "last" properties. That's what the template is looking for. But if you title a Term "First" or "Last" or "first" or "last" or "FIRST" or "LAST" (you get the idea), the Term's __name__ attribute becomes also "first" or "last". This makes the TAL expression (or traversal) to get the Term object instead of the SchoolYear's property.
What are the odds of someone titling Terms like that? I don't know, but I think it's a bug, right?
Related branches
- Gediminas Paulauskas (community): Approve
- Justas Sadzevičius (community): Disapprove
-
Diff: 2105 lines (+1778/-123) (has conflicts)18 files modifiedCHANGES.txt (+4/-0)
src/schooltool/app/browser/ftests/app.txt (+20/-42)
src/schooltool/course/browser/configure.zcml (+33/-0)
src/schooltool/course/browser/ftests/propagate_roster_changes.txt (+210/-0)
src/schooltool/course/browser/ftests/section_linkage.txt (+655/-0)
src/schooltool/course/browser/ftests/sections_and_courses.txt (+17/-39)
src/schooltool/course/browser/section.py (+235/-1)
src/schooltool/course/browser/templates/extend_term.pt (+37/-0)
src/schooltool/course/browser/templates/link_existing.pt (+81/-0)
src/schooltool/course/browser/templates/section.pt (+36/-40)
src/schooltool/course/browser/templates/section_linkage.pt (+79/-0)
src/schooltool/course/browser/templates/unlink_section.pt (+47/-0)
src/schooltool/course/course.zcml (+19/-0)
src/schooltool/course/section.py (+47/-0)
src/schooltool/export/ftests/linked_sections.txt (+197/-0)
src/schooltool/export/ftests/test_all.py (+4/-0)
src/schooltool/export/importer.py (+15/-1)
src/schooltool/skin/resources/schooltool.css (+42/-0)
tags: | added: code-cleanup |
Changed in schooltool: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in schooltool: | |
status: | Confirmed → Fix Committed |
Changed in schooltool: | |
assignee: | nobody → Alan Elkner (aelkner) |
milestone: | none → 1.6.0 |
Changed in schooltool: | |
status: | Fix Committed → Fix Released |
Just ran into this bug again. Annoying.