source: WAeUP_SRP/trunk/skins/waeup_student/apply_admission.py @ 2155

Last change on this file since 2155 was 892, checked in by Henrik Bettermann, 18 years ago

all psm checked and edited

  • Property svn:keywords set to Id
File size: 1.7 KB
RevLine 
[477]1##parameters=REQUEST
[486]2# $Id: apply_admission.py 892 2006-11-18 21:14:18Z henrik $
[477]3"""
4process the Application Form
5return html renderer + psm
6"""
[482]7import DateTime
8current = DateTime.DateTime()
[502]9pr = context.portal_registration
[482]10
11
[477]12type_name = 'StudentApplication'
13ti = context.portal_types[type_name]
14REQUEST.set('type_name',type_name)
15
[478]16validate = REQUEST.has_key("cpsdocument_create_button")
[477]17
18lt = context.portal_layouts
19pr = context.portal_registration
20
[479]21res,psm,ds = lt.renderLayout(layout_id= 'student_application_fe',
22                      schema_id= 'student_application',
[477]23                      context=context,
24                      mapping=validate and REQUEST,
[488]25                      ob={},
[477]26                      layout_mode='create',
27                      formaction = "apply_admission",
[502]28                      button = "Open JAMB Record",
[477]29                      )
30if psm == 'invalid':
31    return context.application_pin_form(rendered = res,
[892]32                                 psm = "Please correct your input!",
[488]33                                 #psm = "%s, %s" % (psm,ds),
[478]34                                 firstlayout = True,
35                                 lastlayout = True,
[477]36                                 ds = ds,
37                                 )
38elif psm == '':
39    return context.application_pin_form(rendered = res,
40                                 psm = None,
[478]41                                 firstlayout = True,
42                                 lastlayout = True,
[477]43                                 ds = ds,
44                                 )
45elif psm == 'valid':
[502]46    s_id = ds.get('s_id')
[511]47    pin = str(ds.get('app_ac_pin'))
[502]48    return context.REQUEST.RESPONSE.redirect("%s/logged_in?__ac_name=%s&__ac_password=%s&pin=%s"
[511]49          % (context.absolute_url(),s_id,pin.split('-')[2],pin))
[543]50
51return
[477]52
[543]53
Note: See TracBrowser for help on using the repository browser.