Adding a group to a section should simply add the current members of the group to the section

Bug #370629 reported by crashsystems on 2009-05-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
High
Justas Sadzevičius

Bug Description

I installed SchoolTools inside in a VM on a fresh Jaunty server install, then added a school year, some courses, teachers and students. When I log into a teacher account and click on the gradebook, I get a ForbiddenAttribute exception. Full traceback below.

Exception

  ForbiddenAttribute: ('username', <schooltool.group.group.Group object at 0xd3cac6c>)
Traceback

  File "/usr/lib/python2.5/site-packages/zope/publisher/publish.py", line 133, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.5/site-packages/zope/app/publication/zopepublication.py", line 167, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.5/site-packages/zope/publisher/publish.py", line 108, in mapply
  return debug_call(obj, args)
Extra information: <zope.app.pagetemplate.simpleviewclass.SimpleViewClass from /usr/lib/python2.5/site-packages/schooltool/gradebook/browser/gradebook_overview.pt object at 0xcbeacec>
File "/usr/lib/python2.5/site-packages/zope/publisher/publish.py", line 114, in debug_call
  return obj(*args)
File "/usr/lib/python2.5/site-packages/zope/app/pagetemplate/simpleviewclass.py", line 44, in __call__
  return self.index(*args, **kw)
File "/usr/lib/python2.5/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.5/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.5/site-packages/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template "/usr/lib/python2.5/site-packages/schooltool/gradebook/browser/gradebook_overview.pt"
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 891, in do_useMacro
  self.interpret(macro)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 521, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 516, in no_tag
  self.interpret(program)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 957, in do_defineSlot
  self.interpret(block)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
  self.do_optTag(stuff)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 521, in do_optTag
  return self.no_tag(start, program)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 516, in no_tag
  self.interpret(program)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 949, in do_defineSlot
  self.interpret(slot)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 346, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.5/site-packages/zope/tal/talinterpreter.py", line 822, in do_loop_tal
  iterator = self.engine.setRepeat(name, expr)
File "/usr/lib/python2.5/site-packages/zope/tales/tales.py", line 682, in setRepeat
  expr = self.evaluate(expr)
File "/usr/lib/python2.5/site-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.5/site-packages/schooltool/gradebook/browser/gradebook_overview.pt", line 172, column 4
  Expression: <PathExpr standard:u'view/table'>
File "/usr/lib/python2.5/site-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.5/site-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.5/site-packages/schooltool/gradebook/browser/gradebook.py", line 392, in table
  'id': student.username,

Tom Hoffman (tom-hoffman) wrote :

Thanks, we'll look into this ASAP.

Changed in schooltool:
assignee: nobody → Alan Elkner (aelkner)
importance: Undecided → High

Let me know if there is any data I can collect on my end that will help with
the debugging.

You didn't mention whether you created any terms or sections. Is it true that you haven't done that yet? Knowing that would help me reproduce the problem.

I've created both a term and a section. The Schooltool install is inside a
VirtualBox VM created just for testing purposes, so if it would help you I
could put the virtual disk image online somewhere for you to download.

Never mind my previous question as I was able to reproduce the problem by creating a section and adding the student group to it. It turns out that adding a group to a section at the time is not working. Could you please remove the student group from your section and add the students individually for now (using the edit individuals link)? We will fix this problem in the short term to allow you to add whole groups to sections in the future and keep you informed as to when that fix is ready.

I removed the "block 2" group from the course, removed the student from that
group, and added the student directly to that course. However, when I log
into the teacher account set as the instructor for that course, I still get
the same error.

Did you do the same steps for all courses (actually we call the instance of a course a section)? When you click on the Gradebook tab at the top, it takes you to the gradebook for the first section in the teacher's list of sections. I'm wondering if that section still has the group added to it.

I was just playing around with the program, and so far have only given that
teacher one course and one section for that course.

Could you please attach a screenshot of the section view?

Tom Hoffman (tom-hoffman) wrote :

Try making a fresh section. Does it work then?

Alan Elkner (aelkner) wrote :

If the first section is still in the state that causes the bug to appear, then adding a new section would not change the behavior of clicking the Gradebook tab because it's only going to take you to the offending section.

I decided to create a new install of SchoolTool on my virtual machine, and
was much more careful about how I structured users, groups, classes, terms
etc. After doing this, I can access the gradebook from a teacher account
just fine. Thanks for all your help.

Renamed bug -- this is something we had talked about doing in the past, but I guess never actually happened. There are too many potentially weird side effects of having section membership automatically change with group membership. Also, apparently it doesn't work anyhow. ;-)

Changed in schooltool:
assignee: Alan Elkner (aelkner) → Justas Sadzevičius (justas-pov)
importance: High → Medium
milestone: none → karmic
summary: - Getting ForbiddenAttribute exception when entering Gradebook as a
- teacher
+ Adding a group to a section should simply add the current members of the
+ group to the section
Changed in schooltool:
importance: Medium → High

If we switch to this simpler functionality, there is no point to have "edit groups" any more - user can add persons from desired group by using filter in "edit individuals". Also we cannot easily identify which groups were added once they're broken to separate individuals.

A simple solution is to remove "edit groups" entirely.

Another idea is to keep "edit groups":
  * When adding a group, add persons who are in the group at the time. If members in group change, section individuals do not.
  * Show "missing in section" individuals for added groups ("Students X (3 not in section)") and have an "update" button to add them.
  * When removing a group, remove individuals who are both in section and the group.

Tom Hoffman (tom-hoffman) wrote :

Let's start with removing "edit groups."

Changed in schooltool:
status: New → In Progress
Changed in schooltool:
status: In Progress → Fix Committed
Changed in schooltool:
milestone: karmic → 2009.4.14
Changed in schooltool:
status: Fix Committed → Fix Released

Was released in 2009.4.13 or 2009.4.12. Can't change a milestone to previous (Launchpad feature), so I'm removing milestone entirely.

Changed in schooltool:
milestone: 2009.4.14 → none
Changed in schooltool:
milestone: none → 2009.4.13
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers