Last change
on this file since 3543 was
3492,
checked in by joachim, 17 years ago
|
fix traceback for anonymous users,
do not show log-message, when student views academic session.
|
File size:
950 bytes
|
Rev | Line | |
---|
[2013] | 1 | ## Script (Python) "getDocumentInfo" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=student=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id:getDocumentInfo.py 486 2006-09-06 10:09:39Z joachim $ |
---|
| 11 | """ |
---|
[3473] | 12 | return Info about a document |
---|
[2013] | 13 | """ |
---|
[3473] | 14 | try: |
---|
| 15 | from Products.zdb import set_trace |
---|
| 16 | except: |
---|
| 17 | def set_trace(): |
---|
| 18 | pass |
---|
| 19 | |
---|
[2013] | 20 | request = context.REQUEST |
---|
| 21 | |
---|
[3473] | 22 | #wf = context.portal_workflow |
---|
| 23 | #path_info = request.get('PATH_INFO').split('/') |
---|
[2013] | 24 | |
---|
[3473] | 25 | # mtool = context.portal_membership |
---|
| 26 | # if mtool.isAnonymousUser(): |
---|
| 27 | # return None |
---|
| 28 | |
---|
| 29 | info = context.waeup_tool.getAccessInfo(context) |
---|
| 30 | #set_trace() |
---|
| 31 | |
---|
| 32 | student_id = info['student_id'] |
---|
[3492] | 33 | # if not info['is_staff'] and student_id is None: |
---|
| 34 | # return info |
---|
| 35 | #return None |
---|
[2013] | 36 | |
---|
[3473] | 37 | titles = context.getStudentObjectTitles() |
---|
| 38 | info['title'] = titles.get(context.portal_type,'') or context.title_or_id |
---|
[2013] | 39 | try: |
---|
| 40 | info['doc'] = context.getContent() |
---|
| 41 | except: |
---|
| 42 | return None |
---|
| 43 | return info |
---|
| 44 | |
---|
Note: See
TracBrowser for help on using the repository browser.