Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- replaceafill@system76:~/sandboxes/flourish$ bzr diff
- === modified file 'src/schooltool/schoolyear/browser/schoolyear.py'
- --- src/schooltool/schoolyear/browser/schoolyear.py 2011-11-21 19:30:28 +0000
- +++ src/schooltool/schoolyear/browser/schoolyear.py 2012-01-10 20:49:53 +0000
- @@ -44,6 +44,7 @@
- from zope.security.checker import canAccess
- from z3c.form import form, field, button
- +from z3c.form.interfaces import IDataConverter
- from z3c.form.util import getSpecification
- from z3c.form.validator import NoInputData
- from z3c.form.validator import WidgetsValidatorDiscriminators
- @@ -627,9 +628,11 @@
- # XXX: hack to display the overlap error next to the widget!
- rv = super(FlourishOverlapValidator, self).validate(value)
- last_widget = self.view.widgets['last']
- + last_field = last_widget.field
- last_value = self.request.get(last_widget.name)
- + converter = getMultiAdapter((last_field, last_widget), IDataConverter)
- try:
- - last_value = last_widget._toFieldValue(last_value)
- + last_value = converter.toFieldValue(last_value)
- except:
- return
- try:
- === modified file 'src/schooltool/term/browser/term.py'
- --- src/schooltool/term/browser/term.py 2011-11-21 10:32:13 +0000
- +++ src/schooltool/term/browser/term.py 2012-01-10 20:53:48 +0000
- @@ -22,7 +22,7 @@
- import datetime
- import itertools
- -from zope.component import adapts
- +from zope.component import adapts, getMultiAdapter
- from zope.interface.exceptions import Invalid
- from zope.interface import implements
- from zope.interface import Interface
- @@ -35,6 +35,7 @@
- from zope.security.checker import canAccess
- from zope.traversing.browser.absoluteurl import absoluteURL
- +from z3c.form.interfaces import IDataConverter
- from z3c.form.util import getSpecification
- from z3c.form.validator import NoInputData
- from z3c.form.validator import WidgetsValidatorDiscriminators
- @@ -511,9 +512,11 @@
- # XXX: hack to display the overlap error next to the widget!
- super(FlourishOverlapValidator, self).validate(value)
- last_widget = self.view.widgets['last']
- + last_field = last_widget.field
- last_value = self.request.get(last_widget.name)
- + converter = getMultiAdapter((last_field, last_widget), IDataConverter)
- try:
- - last_value = last_widget._toFieldValue(last_value)
- + last_value = converter.toFieldValue(last_value)
- except:
- return
- try:
- replaceafill@system76:~/sandboxes/flourish$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement