Last change
on this file since 2070 was
1758,
checked in by joachim, 18 years ago
|
previous sessions students can now pay their previous sessions schoolfees,
please test if "normal" returning students can still pay.
|
-
Property svn:keywords set to
Id
|
File size:
998 bytes
|
Rev | Line | |
---|
[1571] | 1 | ## Script (Python) "getSchoolFeePrefix" |
---|
[1274] | 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:getMaintenancePrefix.py 486 2006-09-06 10:09:39Z joachim $ |
---|
| 11 | """ |
---|
| 12 | return the Prefix for Schoolfee |
---|
| 13 | """ |
---|
[1364] | 14 | |
---|
| 15 | if context.portal_membership.isAnonymousUser(): |
---|
| 16 | return None |
---|
| 17 | |
---|
[1758] | 18 | try: |
---|
| 19 | from Products.zdb import set_trace |
---|
| 20 | except: |
---|
| 21 | def set_trace(): |
---|
| 22 | pass |
---|
[1571] | 23 | import logging |
---|
| 24 | logger = logging.getLogger('Skins.getSchoolFeePrefix') |
---|
[1364] | 25 | |
---|
[1274] | 26 | student_id = context.getStudentId() |
---|
| 27 | sbrain = context.students_catalog(id=student_id)[0] |
---|
| 28 | res = context.portal_catalog(portal_type="Certificate", |
---|
| 29 | id = sbrain.course) |
---|
[1758] | 30 | #set_trace() |
---|
[1274] | 31 | if not res: |
---|
[1571] | 32 | logger.info('%s, certificate %s not found' % (student_id,course)) |
---|
[1286] | 33 | prefix = "--" |
---|
| 34 | else: |
---|
[1274] | 35 | prefix = res[0].getObject().getContent().school_fee_code |
---|
| 36 | if not prefix or prefix == 'none': |
---|
| 37 | prefix = res[0].getPath().split('/')[-4] |
---|
| 38 | return prefix |
---|
Note: See
TracBrowser for help on using the repository browser.