source: WAeUP_SRP/trunk/skins/waeup_student/student_index.py @ 536

Last change on this file since 536 was 535, checked in by joachim, 18 years ago

student apply admission should work now
the default_view for campus is now home_index.py
for students and student student_index.py
these script redirect to the appropriate PT

File size: 1.1 KB
Line 
1## Script (Python) "cpsdocument_edit"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=batch=None
8##title=
9##
10# $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $
11"""
12return the current student_index_html
13"""
14
15request = context.REQUEST
16redirect = request.RESPONSE.redirect
17campus = context.portal_catalog(meta_type = "University")[-1].getObject()
18pm = context.portal_membership
19if pm.isAnonymousUser():
20    return redirect("%s/students_anonymous_view" % campus.students.absolute_url())
21member = pm.getAuthenticatedMember()
22roles = member.getRoles()
23if "Manager" in roles or "SectionManager" in roles:
24    return redirect("%s/students_manager_view" % campus.students.absolute_url())
25   
26info = context.getStudentInfo()
27student = info['student']
28doc = info['app_doc']
29state = context.getStudentInfo()['review_state']
30if state == 'admission_applied':
31    return redirect("%s/application_view" % student.absolute_url())
32elif state == 'application_pin_entered':
33    return redirect("%s/passport_entry_view" % student.absolute_url())
34   
35
Note: See TracBrowser for help on using the repository browser.