← Back to team overview

schooltool-developers team mailing list archive

Jeffrey's journal broke by evolve38

 

Justas:

(This got a little longer than I expected, so have your coffee near :D)

While I was updating Jeffrey's instance to use 2.1 eggs, I noticed a problem with the Journal. The grades don't show up.

I tracked the issue and noticed:

- evolve38 rebuilds the schedules of the sections. Jeffrey's timetables use weekly templates, so the script affects them. If I set the generation version to 37, the 2.1 eggs, including the Journal, worked fine with Jeffrey's Data.fs.

- The SectionJournalData stores the grades in its __grade_data__ attribute using information on the person (__name__) and the meeting (date), but when it retrieves the grades or absences it checks the meeting_id attribute of the meeting (http://bazaar.launchpad.net/~schooltool-owners/schooltool.lyceum.journal/flourish/view/head:/src/schooltool/lyceum/journal/journal.py#L149).

The issue is that evolve38 changes the meeting_id attributes (http://bazaar.launchpad.net/~schooltool-owners/schooltool/flourish/view/head:/src/schooltool/timetable/calendar.py#L113), so the __grade_data__ attributes gets out of sync with the calendars. For example, for the same meeting, the meeting_id value changed from:

(Pdb) old.meeting_id
'2012-04-30.786916175'
(Pdb) new.meeting_id
'2012-04-30.Period%204-'

I saw that the old meeting_id was using a combination of date + int_id, which led me to the root of the problem:

http://bazaar.launchpad.net/~schooltool-owners/schooltool/flourish/revision/3200

When the timetables were made "reimportable" the meeting_id logic was changed to use the title of the period, instead of its int_id. But Jeffrey's timetable were created before this change, so they still use int_ids for the meeting ids.

You can reproduce the problem by:

$ bzr branch lp:schooltool -r 3199 schooltool
$ cd schooltool
$ # EDIT buildout.cfg TO INCLUDE schooltool.lyceum.journal in the [package] eggs
$ make instance
$ # COPY ATTACHED Data.fs to the instance's var directory
$ make run
$ # LOG IN AS jeffrey:pwd and go to http://localhost:7080/schoolyears/2011-2012/quarter-4/sections/1/journal and you should see a few grades
$ CTRL + C to stop the server
$ bzr pull
$ make run
$ # GO AGAIN TO http://localhost:7080/schoolyears/2011-2012/quarter-4/sections/1/journal and the grades are gone

I think this is probably Jeffrey-Data.fs-specific, since evolve38 has been there since February and the timetable int_id modification was made in November (around 1.9.3 - 2.0.0). And we would have already several users complaining about grades disappearing in the Journal :)

I'd appreciate anything you can recommend to bring his instance up to 2.1?

Thanks!

Douglas

"... allí­ es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi

Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html

Attachment: Data.fs
Description: Binary data