Changeset 7428


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

Do not complain if value to set is empty string.

File:
1 edited

Legend:

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

    r7418 r7428  
    141141    def setRenderedValue(self, value):
    142142        """See zope.formlib.interfaces.IWidget"""
    143         if isinstance(value, unicode):
    144             country, area, extension = value.split('-')
     143        if isinstance(value, unicode) and '-' in value:
     144            country, area, extension = value.split('-', 2)
    145145            self.widgets['country'].setRenderedValue(country)
    146146            self.widgets['area'].setRenderedValue(area)
    147147            self.widgets['extension'].setRenderedValue(extension)
    148 
     148            return
     149        return
    149150
    150151    def setPrefix(self, prefix):
Note: See TracChangeset for help on using the changeset viewer.