Changeset 6469 for main


Ignore:
Timestamp:
23 Jun 2011, 12:16:36 (14 years ago)
Author:
Henrik Bettermann
Message:

Check if ac has been used.

File:
1 edited

Legend:

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

    r6465 r6469  
    4040from reportlab.platypus.tables import TableStyle
    4141
    42 from waeup.sirp.accesscodes import invalidate_accesscode
     42from waeup.sirp.accesscodes import invalidate_accesscode, get_access_code
     43from waeup.sirp.accesscodes.workflow import USED
    4344from waeup.sirp.browser import (
    4445    WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage, WAeUPDisplayFormPage)
     
    425426
    426427        # Mark pin as used (this also fires a pin related transition)
    427         comment = u"Invalidated by applicant"
    428         invalidate_accesscode(pin, comment)
     428        if get_access_code(pin).status == USED:
     429            pass
     430        else:
     431            comment = u"Invalidated by applicant"
     432            # Here we know that the ac is in state initialized so we do not
     433            # expect an exception
     434            invalidate_accesscode(pin, comment)
    429435
    430436        if not pin in self.context.keys():
Note: See TracChangeset for help on using the changeset viewer.