Terms cannot be titled "First" or "Last"

Bug #485639 reported by Douglas Cerna
6
This bug affects 1 person
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/schoolyear/browser/templates/schoolyear.pt:

<tal:block tal:content="view/context/first/@@mediumDate" i18n:name="start_date"/>

"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?

Tags: code-cleanup

Related branches

tags: added: code-cleanup
Changed in schooltool:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Justas Sadzevičius (justas.sadzevicius) wrote :

Just ran into this bug again. Annoying.

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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.