Ignore:
Timestamp:
5 Jun 2012, 14:25:40 (12 years ago)
Author:
Henrik Bettermann
Message:

In some custom packages we need to display login credentials on landing pages after registration. Make provisions in base package for that.

File:
1 edited

Legend:

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

    r8627 r8629  
    10031003        return
    10041004
     1005    def _redirect(self, email, password, applicant_id):
     1006        # Forward only email to landing page in base package.
     1007        self.redirect(self.url(self.context, 'registration_complete',
     1008            data = dict(email=email)))
     1009        return
     1010
    10051011    @action(_('Get login credentials'), style='primary')
    10061012    def register(self, **data):
     
    10571063        if kofa_utils.sendCredentials(IUserAccount(applicant),
    10581064            password, login_url, msg):
    1059             self.redirect(self.url(self.context, 'registration_complete',
    1060                                    data = dict(email=applicant.email)))
    1061             return
     1065            email_sent = applicant.email
    10621066        else:
    1063             self.flash(_('Email could not been sent. Please retry later.'))
     1067            email_sent = None
     1068        self._redirect(email=email_sent, password=password,
     1069            applicant_id=applicant.applicant_id)
    10641070        return
    10651071
    10661072class ApplicantRegistrationEmailSent(KofaPage):
    10671073    """Landing page after successful registration.
     1074
    10681075    """
    10691076    grok.name('registration_complete')
     
    10721079    label = _('Your registration was successful.')
    10731080
    1074     def update(self, email=None):
     1081    def update(self, email=None, applicant_id=None, password=None):
    10751082        self.email = email
    1076         return
     1083        self.password = password
     1084        self.applicant_id = applicant_id
     1085        return
Note: See TracChangeset for help on using the changeset viewer.