Changeset 5905 for main/waeup.sirp/trunk


Ignore:
Timestamp:
31 Mar 2011, 10:09:01 (14 years ago)
Author:
uli
Message:

Preliminary code for adding new applicants in case new applicant
logged in for the first time.

File:
1 edited

Legend:

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

    r5896 r5905  
    308308            return
    309309
    310         print self.request.principal
    311         # If record does not exist: create
    312         # Then: redirect to record...
     310        pin = self.request.principal.access_code
     311        if pin not in self.context.keys():
     312            # Create applicant record
     313            self.flash("CREATE APPLICANT")
     314            return
     315            raise("Create APPLICANT")
     316            applicant = Applicant()
     317            applicant.access_code = pin
     318            self.context[pin] = applicant
     319            # XXX: set owner role on created applicant
     320
     321        self.redirect(self.url(self.context[pin]))
    313322        return
    314323
Note: See TracChangeset for help on using the changeset viewer.