source: waeup_product/trunk/skins/waeup_student/process_waeup_login.py @ 66

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

=more

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1##parameters=member=None,sc_pin=None
2# $Id: process_waeup_login.py 57 2005-10-19 09:42:03Z joachim $
3"""
4Process a student after login
5
6"""
7request = context.REQUEST
8response=request.response
9
10if request.form.get('submit') == 'Login':
11    if "Students" in member.getGroups():
12        ca = context.portal_catalog(id = str(member))
13    elif "StudentManager" in member.getGroups():
14        ca = context.portal_catalog(id = 'students')
15    ma = ca[0].getObject()
16    return response.redirect(ma.absolute_url())
17       
18member_id = str(member)
19ma = getattr(context,member_id)
20jkw = {'admission_sc_pin': sc_pin}
21jamb = getattr(ma,'JAMB')
22jamb.edit(mapping=jkw)
23#pdid = 'personal%s' % member_id
24pdid = 'PERSONAL'
25ma.invokeFactory('StudentPersonal', pdid)
26pd = getattr(ma,pdid)   
27pkw = {}
28pkw['sex'] = getattr(jamb,'sex')
29pkw['firstname'] = getattr(jamb,'firstname')
30pkw['middlename'] = getattr(jamb,'middlename')
31pkw['lastname'] = getattr(jamb,'lastname')
32pkw['aggregate'] = getattr(jamb,'aggregate')
33pkw['faculty'] = getattr(jamb,'faculty')
34pkw['age'] = getattr(jamb,'age')
35pkw['state'] = getattr(jamb,'state')
36
37pd.edit(mapping=pkw)
38context.notifyCPSDocumentCreation(ob=pd)
39return response.redirect(ma.absolute_url())
40
Note: See TracBrowser for help on using the repository browser.