Activity categories missing empty field validation

Bug #585805 reported by Nuno Covas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SchoolTool Gradebook
Fix Released
Medium
Gediminas Paulauskas

Bug Description

This is minor, but in the Activity Categories panel, clicking the "Add" button without filling in the "New Category" field will throw an exception.

Exception

  WidgetsError: WidgetInputError: ('newCategory', u'New Category', RequiredMissing('newCategory'))
Traceback

  File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 134, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.6/dist-packages/zope/app/publication/zopepublication.py", line 205, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 109, in mapply
  return debug_call(obj, args)
Extra information: <zope.browserpage.simpleviewclass.SimpleViewClass from /usr/lib/python2.6/dist-packages/schooltool/gradebook/browser/categories.pt object at 0xeb8730c>
File "/usr/lib/python2.6/dist-packages/zope/publisher/publish.py", line 115, in debug_call
  return obj(*args)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/simpleviewclass.py", line 44, in __call__
  return self.index(*args, **kw)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 83, in __call__
  return self.im_func(im_self, *args, **kw)
File "/usr/lib/python2.6/dist-packages/zope/browserpage/viewpagetemplatefile.py", line 51, in __call__
  sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
File "/usr/lib/python2.6/dist-packages/zope/pagetemplate/pagetemplate.py", line 115, in pt_render
  strictinsert=0, sourceAnnotations=sourceAnnotations)()
Template "/usr/lib/python2.6/dist-packages/schooltool/gradebook/browser/categories.pt"
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 271, in __call__
  self.interpret(self.program)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 343, in interpret
  handlers[opcode](self, args)
File "/usr/lib/python2.6/dist-packages/zope/tal/talinterpreter.py", line 583, in do_setLocal_tal
  self.engine.setLocal(name, self.engine.evaluateValue(expr))
File "/usr/lib/python2.6/dist-packages/zope/tales/tales.py", line 696, in evaluate
  return expression(self)
Template "/usr/lib/python2.6/dist-packages/schooltool/gradebook/browser/categories.pt", line 1, column 0
  Expression: <PathExpr standard:u'view/update'>
File "/usr/lib/python2.6/dist-packages/zope/tales/expressions.py", line 217, in __call__
  return self._eval(econtext)
File "/usr/lib/python2.6/dist-packages/zope/tales/expressions.py", line 211, in _eval
  return ob()
File "/usr/lib/python2.6/dist-packages/schooltool/gradebook/browser/category.py", line 79, in update
  self, ICategoriesForm, names=['newCategory'])['newCategory']
File "/usr/lib/python2.6/dist-packages/zope/app/form/utility.py", line 356, in getWidgetsData
  raise WidgetsError(errors, widgetsData=result)

Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Thanks for reporting this -- we want to know about any traceback errors.

Changed in schooltool.gradebook:
assignee: nobody → Alan Elkner (aelkner)
importance: Undecided → Medium
milestone: none → 0.7.1
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

Made it do nothing in this case, no error.
Also the new category field is cleared after adding.

Changed in schooltool.gradebook:
assignee: Alan Elkner (aelkner) → Gediminas Paulauskas (menesis)
status: New → Fix Committed
Changed in schooltool.gradebook:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.