##parameters=REQUEST # $Id: apply_admission.py 649 2006-10-11 06:24:39Z joachim $ """ process the Application Form return html renderer + psm """ import DateTime current = DateTime.DateTime() pr = context.portal_registration type_name = 'StudentApplication' ti = context.portal_types[type_name] REQUEST.set('type_name',type_name) validate = REQUEST.has_key("cpsdocument_create_button") lt = context.portal_layouts pr = context.portal_registration res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe', schema_id= 'student_application', context=context, mapping=validate and REQUEST, ob={}, layout_mode='create', formaction = "apply_admission", button = "Open JAMB Record", ) if psm == 'invalid': return context.application_pin_form(rendered = res, psm = "Please correct your input.", #psm = "%s, %s" % (psm,ds), firstlayout = True, lastlayout = True, ds = ds, ) elif psm == '': return context.application_pin_form(rendered = res, psm = None, firstlayout = True, lastlayout = True, ds = ds, ) elif psm == 'valid': s_id = ds.get('s_id') pin = str(ds.get('app_ac_pin')) return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s" % (context.absolute_url(),s_id,pin.split('-')[2],pin)) return