##parameters=REQUEST # $Id: personal_addon.py 179 2005-11-16 16:44:13Z 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_personal_addon', schema_id= 'student_personal', context=context, mapping=validate and REQUEST, ob={}, layout_mode='create', ) res = jamb_rendered + res if psm == 'invalid': return context.personal_addon_form(rendered = res, #psm = str(ds), psm = "Please correct your input", ds = ds, ) elif psm == '': return context.personal_addon_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 has been successfully set. ' ##return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students')) return context.eligibility()