Section schedule view can't be accessed after deleting the related timetable

Bug #868357 reported by Douglas Cerna on 2011-10-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool
High
Justas Sadzevičius

Bug Description

jelkner had this issue recently. He deleted a timetable which had already been used in some section schedules. He created a new one and when he visited the schedule view to associate the new timetable he got the traceback below. Should we "destroy" all the related schedules (as the timetable Delete dialog says)? or maybe allow access to the schedule view and show an error like "The associated timetable has been deleted" and allow the user to Delete the schedule?

----------------- %< -----------------

2011-10-05 13:10:11,305 http://69.164.203.135:6660/schoolyears/2010-2011/2011-spring/sections/art_a_2011-spring_teacher010_000/schedule/@@index.html
Traceback (most recent call last):
  File "/home/replaceafill/.buildout/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 132, in publish
    result = publication.callObject(request, obj)
  File "/home/replaceafill/.buildout/eggs/zope.app.publication-3.13.2-py2.6.egg/zope/app/publication/zopepublication.py", line 207, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/home/replaceafill/.buildout/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 107, in mapply
    return debug_call(obj, args)
  File "/home/replaceafill/.buildout/eggs/zope.publisher-3.12.6-py2.6.egg/zope/publisher/publish.py", line 113, in debug_call
    return obj(*args)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/skin/flourish/page.py", line 72, in __call__
    result = self.render(*args, **kw)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/skin/flourish/page.py", line 65, in render
    return self.template(*args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 211, in _eval
    return ob()
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
    self.engine.setLocal(name, self.engine.evaluateValue(expr))
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 211, in _eval
    return ob()
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 852, in do_condition
    self.interpret(block)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 821, in do_loop_tal
    self.interpret(block)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 211, in _eval
    return ob()
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/skin/flourish/content.py", line 58, in __call__
    return self.render(*args, **kw)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/skin/flourish/zcml_content.py", line 125, in <lambda>
    setattr(new_class, attr, lambda *a, **kw: method(*a, **kw))
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 533, in do_optTag_tal
    self.do_optTag(stuff)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 518, in do_optTag
    return self.no_tag(start, program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 710, in do_insertTranslation
    self.interpret(stuff[1])
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 652, in do_i18nVariable
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 211, in _eval
    return ob()
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/skin/flourish/content.py", line 58, in __call__
    return self.render(*args, **kw)
  File "/home/replaceafill/.buildout/eggs/zope.browserpage-3.12.2-py2.6.egg/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/common/inlinept.py", line 111, in __call__
    showtal=getattr(instance.request.debug, 'showTAL', False),
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/pagetemplate.py", line 113, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 271, in __call__
    self.interpret(self.program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 531, in do_optTag_tal
    self.no_tag(stuff[-2], stuff[-1])
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 513, in no_tag
    self.interpret(program)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 343, in interpret
    handlers[opcode](self, args)
  File "/home/replaceafill/.buildout/eggs/zope.tal-3.5.2-py2.6.egg/zope/tal/talinterpreter.py", line 742, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/tales.py", line 696, in evaluate
    return expression(self)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 217, in __call__
    return self._eval(econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 194, in _eval
    ob = self._subexprs[-1](econtext)
  File "/home/replaceafill/.buildout/eggs/zope.tales-3.5.1-py2.6.egg/zope/tales/expressions.py", line 124, in _eval
    ob = self._traverser(ob, element, econtext)
  File "/home/replaceafill/.buildout/eggs/zope.pagetemplate-3.5.2-py2.6.egg/zope/pagetemplate/engine.py", line 66, in __call__
    request=request)
  File "/home/replaceafill/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/adapters.py", line 136, in traversePathElement
    return traversable.traverse(nm, further_path)
  File "/home/replaceafill/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/adapters.py", line 42, in traverse
    attr = getattr(subject, name, _marker)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/app/browser/app.py", line 714, in title
    title = getattr(self.context, 'title', __not_set)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/securitypolicy/policy.py", line 45, in checkPermission
    return self.checkByAdaptation(permission, obj)
  File "/home/replaceafill/sandboxes/st-flourish/src/schooltool/securitypolicy/policy.py", line 52, in checkByAdaptation
    obj = getParent(obj)
  File "/home/replaceafill/.buildout/eggs/zope.traversing-3.13.2-py2.6.egg/zope/traversing/api.py", line 135, in getParent
    return location_info.getParent()
  File "/home/replaceafill/.buildout/eggs/zope.location-3.9.1-py2.6.egg/zope/location/traversing.py", line 192, in getParent
    self.context)
TypeError: ('Not enough context information to get parent', <schooltool.timetable.timetable.Timetable object at 0xe8debec>)

----------------- %< -----------------

Changed in schooltool:
importance: Undecided → Critical
assignee: nobody → Justas Sadzevičius (justas-pov)
Changed in schooltool:
status: New → Triaged
tags: added: flourish timetables
Changed in schooltool:
milestone: none → 1.9.2
importance: Critical → High
Changed in schooltool:
status: Triaged → In Progress
status: In Progress → Fix Committed
Changed in schooltool:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers