1 | ##parameters=member=None,sc_pin=None |
---|
2 | # $Id: process_waeup_login.py 152 2005-11-04 17:07:18Z joachim $ |
---|
3 | """ |
---|
4 | Process a student after login |
---|
5 | |
---|
6 | """ |
---|
7 | request = context.REQUEST |
---|
8 | response=request.response |
---|
9 | |
---|
10 | if request.form.get('submit') == 'Login': |
---|
11 | #waeup = context.portal_catalog(id = 'demouni')[0] |
---|
12 | waeup = context.portal_catalog(portal_type = 'University')[0] |
---|
13 | if "Manager" in member.getRoles(): |
---|
14 | return |
---|
15 | return response.redirect(waeup.getURL()) |
---|
16 | |
---|
17 | member_id = str(member) |
---|
18 | ma = getattr(context,member_id) |
---|
19 | jkw = {'admission_sc_pin': sc_pin} |
---|
20 | jamb = getattr(ma,'JAMB') |
---|
21 | jamb.getContent().edit(mapping=jkw) |
---|
22 | #pdid = 'personal%s' % member_id |
---|
23 | pdid = 'PERSONAL' |
---|
24 | ma.invokeFactory('StudentPersonal', pdid) |
---|
25 | pd = getattr(ma,pdid) |
---|
26 | pkw = {} |
---|
27 | jc = jamb.getContent() |
---|
28 | pkw['sex'] = getattr(jc,'sex') |
---|
29 | pkw['firstname'] = getattr(jc,'firstname') |
---|
30 | pkw['middlename'] = getattr(jc,'middlename') |
---|
31 | pkw['lastname'] = getattr(jc,'lastname') |
---|
32 | pkw['aggregate'] = getattr(jc,'aggregate') |
---|
33 | pkw['faculty'] = getattr(jc,'faculty') |
---|
34 | pkw['age'] = getattr(jc,'age') |
---|
35 | pkw['state'] = getattr(jc,'state') |
---|
36 | |
---|
37 | pd.getContent().edit(mapping=pkw) |
---|
38 | context.notifyCPSDocumentCreation(ob=pd) |
---|
39 | return response.redirect(ma.absolute_url()) |
---|
40 | |
---|