Ignore:
Timestamp:
14 Mar 2012, 17:18:39 (13 years ago)
Author:
uli
Message:

In phonewidget consider *-- as missing value.

File:
1 edited

Legend:

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

    r7874 r7883  
    127127                _("Phone numbers may contain numbers only."),
    128128                ValueError('non numbers in phone number'))
    129         if result in ('--', '', None):
     129        # We consider also values ending with '--' as missing values.
     130        # This means that any prefix setting in the form will switch
     131        # back to default upon submit if no further phone fields are filled.
     132        # As advantage we get only valid phone numbers or missing value.
     133        if result in ('', None) or result.endswith('--'):
    130134            result = self.context.missing_value
    131135        return result
Note: See TracChangeset for help on using the changeset viewer.