1 | ##parameters=member=None,sc_pin=None |
---|
2 | # $Id: process_waeup_login.py 251 2006-06-06 08:07:12Z 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 | |
---|
16 | member_id = str(member) |
---|
17 | ma = getattr(context,member_id) |
---|
18 | jkw = {'admission_sc_pin': sc_pin} |
---|
19 | jamb = getattr(ma,'JAMB') |
---|
20 | jamb.getContent().edit(mapping=jkw) |
---|
21 | #pdid = 'personal%s' % member_id |
---|
22 | pdid = 'PERSONAL' |
---|
23 | ma.invokeFactory('StudentPersonal', pdid) |
---|
24 | pd = getattr(ma,pdid) |
---|
25 | pkw = {} |
---|
26 | jc = jamb.getContent() |
---|
27 | pkw['sex'] = getattr(jc,'sex') |
---|
28 | pkw['firstname'] = getattr(jc,'firstname') |
---|
29 | pkw['middlename'] = getattr(jc,'middlename') |
---|
30 | pkw['lastname'] = getattr(jc,'lastname') |
---|
31 | pkw['aggregate'] = getattr(jc,'aggregate') |
---|
32 | pkw['faculty'] = getattr(jc,'faculty') |
---|
33 | pkw['course'] = getattr(jc,'course') |
---|
34 | pkw['age'] = getattr(jc,'age') |
---|
35 | pkw['jamb_results'] = getattr(jc,'exam_results') |
---|
36 | pkw['jamb_aggregate'] = getattr(jc,'aggregate') |
---|
37 | pkw['jamb_listing_date'] = getattr(jc,'listing_date') |
---|
38 | pkw['state'] = getattr(jc,'state') |
---|
39 | |
---|
40 | pd.getContent().edit(mapping=pkw) |
---|
41 | context.notifyCPSDocumentCreation(ob=pd) |
---|
42 | |
---|
43 | pdid = 'DOCUMENTS' |
---|
44 | ma.invokeFactory('StudentDocuments', pdid) |
---|
45 | pd = getattr(ma,pdid) |
---|
46 | context.notifyCPSDocumentCreation(ob=pd) |
---|
47 | |
---|
48 | pdid = 'ELIGIBILITY' |
---|
49 | ma.invokeFactory('StudentEligibility', pdid) |
---|
50 | pd = getattr(ma,pdid) |
---|
51 | pd.getContent().edit(mapping=pkw) |
---|
52 | context.notifyCPSDocumentCreation(ob=pd) |
---|
53 | |
---|
54 | return response.redirect("%s" % ma.absolute_url()) |
---|
55 | #return ma.personal_addon(REQUEST=context.REQUEST) |
---|
56 | |
---|