Ignore:
Timestamp:
2 Mar 2012, 08:31:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Catch ValueError? exception.

Location:
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/browser.txt

    r7719 r7748  
    304304      <td>initialized</td>
    305305      <td>... - initialized by Manager</td>
     306    ...
     307
     308Searching for non-integer values does not result in an exception:
     309
     310    >>> ctrl = browser.getControl(name='searchtype')
     311    >>> ctrl.getControl(value='batch_serial').selected = True
     312    >>> browser.getControl(name='searchterm').value = 'xyz'
     313    >>> browser.getControl('Search').click()
     314    >>> print browser.contents
     315    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    306316    ...
    307317
  • main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/catalog.py

    r7195 r7748  
    6262            Text(('accesscodes_catalog', searchtype), query))
    6363    elif searchtype == 'batch_serial':
    64         results = Query().searchResults(
    65             Eq(('accesscodes_catalog', searchtype), int(query)))
     64        try:
     65            results = Query().searchResults(
     66                Eq(('accesscodes_catalog', searchtype), int(query)))
     67        except ValueError:
     68            return
    6669    else:
    6770        results = Query().searchResults(
Note: See TracChangeset for help on using the changeset viewer.