source: WAeUP_SRP/base/skins/waeup_student/firsttime_login.py @ 3381

Last change on this file since 3381 was 1782, checked in by Henrik Bettermann, 17 years ago

method, form and layout renamed

File size: 1.7 KB
Line 
1##parameters=REQUEST
2# $Id: firsttime_login.py 1747 2007-05-07 20:56:24Z joachim $
3"""
4process the Application Form
5return html renderer + psm
6"""
7import DateTime
8from urllib import urlencode
9current = DateTime.DateTime()
10pr = context.portal_registration
11
12validate = REQUEST.has_key("cpsdocument_create_button")
13
14lt = context.portal_layouts
15#pr = context.portal_registration
16
17res,psm,ds = lt.renderLayout(layout_id= 'student_firsttime_login',
18                      schema_id= 'student_returning',
19                      context=context,
20                      mapping=validate and REQUEST,
21                      ob={},
22                      layout_mode='create',
23                      formaction = "firsttime_login",
24                      button = "Search",
25                      commit=False,
26                      )
27if psm == 'invalid':
28    return context.firsttime_login_form(rendered = res,
29                                 psm = "Please correct your input!",
30                                 #psm = "%s, %s" % (psm,ds),
31                                 firstlayout = True,
32                                 lastlayout = True,
33                                 ds = ds,
34                                 )
35elif psm == '':
36    return context.firsttime_login_form(rendered = res,
37                                 psm = None,
38                                 firstlayout = True,
39                                 lastlayout = True,
40                                 ds = ds,
41                                 )
42elif psm == 'valid':
43    pass
44action = "/set_access_data"
45args = {}
46args['matric_no'] = ds.get('matric_no')
47args['name'] = ds.get('student').name
48url = context.absolute_url() + action + '?' + urlencode(args)
49REQUEST.RESPONSE.redirect(url)
Note: See TracBrowser for help on using the repository browser.