~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:59:40 UTC
  • Revision ID: matt.giuca@gmail.com-20091208075940-nmfytitfo9qd9fle
admin/subject: Admin users now see all offerings in the system, not just the ones they are enrolled in.

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
 
            offerings = [enrolment.offering for enrolment in
 
69
            if req.user.admin:
 
70
                # For admins, show all subjects in the system
 
71
                offerings = list(semester.offerings.find())
 
72
            else:
 
73
                offerings = [enrolment.offering for enrolment in
70
74
                                    semester.enrolments.find(user=req.user)]
71
75
            if len(offerings):
72
76
                ctx['semesters'].append((semester, offerings))