Changeset 8074


Ignore:
Timestamp:
9 Apr 2012, 10:31:02 (13 years ago)
Author:
Henrik Bettermann
Message:

The 'ext' part of the phone widget should be optional.

File:
1 edited

Legend:

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

    r7883 r8074  
    121121                _("Int. prefix requires format '+NNN'"),
    122122                ValueError('invalid international prefix'))
    123         if (parts[1] != '' and not RE_NUMBERS.match(parts[1])) or (
    124             parts[2] != '' and not RE_NUMBERS_AND_HYPHENS.match(
    125             parts[2])):
     123        error1 = parts[1] != '' and not RE_NUMBERS.match(parts[1])
     124        if len(parts) == 3:
     125            error2 = parts[2] != '' and not RE_NUMBERS_AND_HYPHENS.match(parts[2])
     126        else:
     127            error2 = False
     128        if error1 or error2:
    126129            raise ConversionError(
    127130                _("Phone numbers may contain numbers only."),
Note: See TracChangeset for help on using the changeset viewer.