Changeset 12261
- Timestamp:
- 19 Dec 2014, 08:14:25 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/customers/tests/test_batching.py
r12260 r12261 268 268 content, 269 269 'reg_number,password,firstname,lastname,sex,phone,state,date_of_birth,customer_id,email,--ERRORS--\r\n' 270 '1,,Frank,Meyer,m,1234,,1990-01-06,F123456,aa@aa.ng,reg_number: reg_number\r\n'270 '1,,Frank,Meyer,m,1234,,1990-01-06,F123456,aa@aa.ng,reg_number: Invalid input\r\n' 271 271 '3,,Uli,Schulz,m,1234,,1990-01-07,A123456,aa@aa.ng,This object already exists. Skipping.\r\n' 272 272 -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/converters.py
r11949 r12261 23 23 from zope.formlib.boolwidgets import CheckBoxWidget 24 24 from zope.formlib.form import ( 25 _widgetKey, WidgetInputError, ValidationError, InputErrors, expandPrefix) 26 from zope.formlib.interfaces import IInputWidget 25 _widgetKey, WidgetInputError, ValidationError, InputErrors, 26 expandPrefix) 27 from zope.formlib.interfaces import IInputWidget, ConversionError 27 28 from zope.interface import Interface 28 29 from zope.publisher.browser import TestRequest … … 87 88 88 89 This is merely a copy from the same-named function in 89 :mod:`zope.formlib.form`. The onlydifference is that we also90 :mod:`zope.formlib.form`. The first difference is that we also 90 91 store the fieldname for which a validation error happened in the 91 92 returned error list (what the original does not do). 93 The second difference is that we return only ConversionError objects. 92 94 """ 93 95 errors = [] … … 104 106 data[name] = widget.getInputValue() 105 107 except ValidationError, error: 106 # convert field ValidationError to WidgetInputError 107 error = WidgetInputError(widget.name, widget.label, error) 108 error = ConversionError(u'Validation failed') 108 109 errors.append((name, error)) 109 except InputErrors, error: 110 except WidgetInputError, error: 111 error = ConversionError(u'Invalid input') 112 errors.append((name, error)) 113 except ConversionError, error: 110 114 errors.append((name, error)) 111 115
Note: See TracChangeset for help on using the changeset viewer.