Ignore:
Timestamp:
20 Dec 2011, 12:35:01 (13 years ago)
Author:
uli
Message:

Fix case where phonewidget itself does not require input.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/widgets/phonewidget.py

    r7360 r7411  
    3636from zope.component import getMultiAdapter
    3737from zope.formlib import form
    38 from zope.formlib.interfaces import IBrowserWidget, IWidgetInputErrorView
    39 from zope.formlib.interfaces import IInputWidget, WidgetInputError
     38from zope.formlib.interfaces import (
     39    IBrowserWidget, IWidgetInputErrorView, IInputWidget, WidgetInputError,
     40    MissingInputError)
    4041from zope.formlib.widget import SimpleInputWidget
    4142from zope.interface import Interface, implements
     43from zope.schema.interfaces import RequiredMissing
    4244
    4345class IPhoneData(Interface):
     
    171173            raise self._error
    172174        except WidgetInputError, e:
     175            # Subwidgets require input. We have to work around that if
     176            # the parent widget does not require input.
     177            missing = isinstance(e.errors, RequiredMissing)
     178            missing = missing or isinstance(e, MissingInputError)
     179            if not self.required and missing:
     180                return self._missing
    173181            self._error = e
    174182            raise e
Note: See TracChangeset for help on using the changeset viewer.