Ignore:
Timestamp:
12 Jun 2011, 12:00:19 (13 years ago)
Author:
uli
Message:

PIN stuff.

File:
1 edited

Legend:

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

    r6358 r6359  
    3232
    3333from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState
    34 
    3534from reportlab.pdfgen import canvas
    3635
     36from waeup.sirp.accesscodes import invalidate_accesscode
    3737from waeup.sirp.browser import (
    3838    WAeUPPage, WAeUPEditFormPage, WAeUPAddFormPage, WAeUPDisplayFormPage)
     
    415415            return
    416416        pin = self.request.principal.access_code
    417         if pin not in self.context.keys():
    418             # Create applicant record
    419             applicant = Applicant()
    420             applicant.access_code = pin
    421             self.context[pin] = applicant
     417        if pin in self.context.keys():
     418            self.redirect(self.url(self.context[pin], 'edit'))
     419            return
     420
     421        # Mark pin as used
     422        invalidate_accesscode(pin)
     423
     424        # Create applicant record
     425        applicant = Applicant()
     426        applicant.access_code = pin
     427        self.context[pin] = applicant
     428
    422429        # Assign current principal the owner role on created applicant
    423430        # record
Note: See TracChangeset for help on using the changeset viewer.