~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/subject.py

  • Committer: Matt Giuca
  • Date: 2009-12-08 07:50:30 UTC
  • Revision ID: matt.giuca@gmail.com-20091208075030-sdpa1sfn8j8usrfb
admin/subject: Now sends a list of offerings the user is enrolled in to the Genshi template, rather than a list of enrolment objects (of which only the offering is observed). This allows us to send non-enrolment offerings to the template.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        ctx['semesters'] = []
67
67
        for semester in req.store.find(Semester).order_by(Desc(Semester.year),
68
68
                                                     Desc(Semester.semester)):
69
 
            enrolments = semester.enrolments.find(user=req.user)
70
 
            if enrolments.count():
71
 
                ctx['semesters'].append((semester, enrolments))
 
69
            offerings = [enrolment.offering for enrolment in
 
70
                                    semester.enrolments.find(user=req.user)]
 
71
            if len(offerings):
 
72
                ctx['semesters'].append((semester, offerings))
72
73
 
73
74
 
74
75
class UserValidator(formencode.FancyValidator):