source: WAeUP_SRP/branches/srpp_on_branch/skins/waeup_default/getReviewInfo.py @ 7657

Last change on this file since 7657 was 1191, checked in by joachim, 18 years ago

fix undefined d_review

  • Property svn:keywords set to Id
File size: 830 bytes
Line 
1## Script (Python) "getReviewInfo"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None, with_items=None
8##title=
9##
10# $Id: getReviewInfo.py 1191 2007-01-03 19:55:57Z joachim $
11"""
12return Info about the current Student
13"""
14ptool = context.portal_proxies
15wf_vars = ['review_state']
16docid = context.getDocid()
17if docid:
18    proxies_info = ptool.getProxyInfosFromDocid(docid,
19                                                workflow_vars=wf_vars)
20    d_review = proxies_info[0]['review_state']
21else:
22    d_review = ''
23if context.portal_type != "Student":
24    student_id = context.getStudentId()
25    res = context.portal_catalog(id = student_id,portal_type='Student')
26    if res:
27        s_review = res[-1].review_state
28        return "%s / %s" % (s_review,d_review)
29return "%s" % (d_review)
30
Note: See TracBrowser for help on using the repository browser.