##parameters=REQUEST # $Id: eligibility.py 175 2005-11-15 18:59:35Z joachim $ """ process the Admission Form return html renderer + psm """ type_name = 'Jamb' ti = context.portal_types[type_name] REQUEST.set('type_name',type_name) validate = REQUEST.has_key("cpsdocument_edit_button") lt = context.portal_layouts pr = context.portal_registration pm = context.portal_membership jamb = getattr(context,'JAMB') jamb_rendered = jamb.getContent().render(layout_id = 'admission_slip', layout_mode = 'view', schema_id = 'jamb') res,psm,ds = lt.renderLayout(layout_id= 'student_eligibility', schema_id= 'student_eligibility', context=context, mapping=validate and REQUEST, ob={}, layout_mode='create', ) res = jamb_rendered + res if psm == 'invalid': return context.eligibility_form(rendered = res, #psm = str(ds), psm = "Please correct your input", ds = ds, ) elif psm == '': return context.eligibility_form(rendered = res, psm = None, ds = ds, ) elif psm == 'valid': s_personal = context.PERSONAL.getContent() s_personal.edit(mapping={'email': ds.get('email')}) #pw = REQUEST.get("widget__pw") #pm.setPassword(pw) psm = 'Email hay been successfully set.' return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students')) ##return context.eligibility_form(rendered = res, ## psm = psm, ## ds = ds, ## )