source: waeup_product/trunk/skins/waeup_student/eligibility.py @ 175

Last change on this file since 175 was 175, checked in by joachim, 19 years ago

=fixed clearEnce

  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[164]1##parameters=REQUEST
2# $Id: eligibility.py 175 2005-11-15 18:59:35Z joachim $
3"""
4process the Admission Form
5return html renderer + psm
6"""
7type_name = 'Jamb'
8ti = context.portal_types[type_name]
9
10REQUEST.set('type_name',type_name)
11
12validate = REQUEST.has_key("cpsdocument_edit_button")
13
14
15lt = context.portal_layouts
16pr = context.portal_registration
17pm = context.portal_membership
18
19jamb = getattr(context,'JAMB')
20jamb_rendered = jamb.getContent().render(layout_id = 'admission_slip',
21                               layout_mode = 'view',
22                               schema_id = 'jamb')
23
24res,psm,ds = lt.renderLayout(layout_id= 'student_eligibility',
25                      schema_id= 'student_eligibility',
26                      context=context,
27                      mapping=validate and REQUEST,
28                      ob={},
29                      layout_mode='create',
30                      )
31res = jamb_rendered + res
32if psm == 'invalid':
33    return context.eligibility_form(rendered = res,
34                                 #psm = str(ds),
35                                 psm = "Please correct your input",
36                                 ds = ds,
37                                 )
38elif psm == '':
39    return context.eligibility_form(rendered = res,
40                                 psm = None,
41                                 ds = ds,
42                                 )
43elif psm == 'valid':
44    s_personal = context.PERSONAL.getContent()
45    s_personal.edit(mapping={'email': ds.get('email')})
[173]46    #pw = REQUEST.get("widget__pw")
47    #pm.setPassword(pw)
48psm = 'Email hay been successfully set.'
[175]49return context.REQUEST.RESPONSE.redirect('%s' % context.portal_url.getUrlFromRpath('/students'))
50
51##return context.eligibility_form(rendered = res,
52##                                 psm = psm,
53##                                 ds = ds,
54##                                 )
Note: See TracBrowser for help on using the repository browser.