Ignore:
Timestamp:
10 Aug 2011, 21:59:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Undo last changes. Modify invalidate_accesscode function instead. invalidate_accesscode now returns True or False.

File:
1 edited

Legend:

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

    r6587 r6588  
    460460        batch_id, ac_id = access_code.rsplit('-', 1)
    461461    except ValueError:
    462         return False
     462        raise ValueError(
     463            'Invalid access code format: %s (use: APP-N-XXXXXXXX)' % (
     464                access_code,))
    463465    try:
    464466        ac = grok.getSite()['accesscodes'][batch_id].getAccessCode(access_code)
    465     except:
    466         return False
     467    except TypeError:
     468        raise KeyError(
     469            'No site available for looking up accesscodes')
    467470    info = IWorkflowInfo(ac)
    468471    if toward:
     
    483486    meanings.
    484487    """
    485     return fire_transition(access_code, 'use', comment=comment)
     488    try:
     489        fire_transition(access_code, 'use', comment=comment)
     490        return True
     491    except:
     492        return False
    486493
    487494def disable_accesscode(access_code, comment=None):
Note: See TracChangeset for help on using the changeset viewer.