source: WAeUP_SRP/base/skins/waeup_student/getApplicationInfo.py @ 2944

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

upload missing passport before starting clearance (logic in application_edit.py completely changed)

fix Title for student_accommodation object

  • Property svn:keywords set to Id
File size: 1.4 KB
RevLine 
[1161]1## Script (Python) "getApplicationInfo"
[1071]2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: getApplicationInfo.py 2920 2007-12-11 15:40:35Z henrik $
11"""
12return Info about the current Student
13"""
14
15request = context.REQUEST
16mtool = context.portal_membership
17wf = context.portal_workflow
18member = mtool.getAuthenticatedMember()
19member_id = str(member)
20path_info = request.get('PATH_INFO').split('/')
[1078]21##from Products.zdb import set_trace
22##set_trace()
[1071]23if mtool.isAnonymousUser():
24    return None
25info = {}
26requested_id = context.getStudentId()
[1090]27if requested_id and not context.isStaff() and member_id != requested_id:
[2335]28    import logging
29    logger = logging.getLogger('Skins.getApplicationInfo')
[1571]30    logger.info('%s tried to access application object of %s' % (member_id,requested_id))
[1161]31    student_id = requested_id
[1571]32    return None
[1090]33elif context.isStaff():
34    student_id = requested_id
[1088]35else:
[1071]36    student_id = member_id
37
[2920]38info['has_passport'] = context.waeup_tool.picturesExist(('passport',), student_id)
[1071]39
40students_object = context.portal_url.getPortalObject().campus.students
41student = getattr(students_object, student_id)
42info['id'] = student_id
43info['student'] = student
[1871]44info['review_state'] = context.getStudentReviewState()
[1071]45info['app'] = student.application
46info['app_doc'] = student.application.getContent()
[1435]47#info['name'] = context.getStudentName()
[1071]48return info
Note: See TracBrowser for help on using the repository browser.