Last change
on this file since 3427 was
3329,
checked in by Henrik Bettermann, 17 years ago
|
enable school fee payment for 07 new students
|
File size:
1.1 KB
|
Rev | Line | |
---|
[3060] | 1 | ## Script (Python) "getSchoolFeePrefix" |
---|
| 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 | """ |
---|
| 14 | |
---|
| 15 | if context.portal_membership.isAnonymousUser(): |
---|
| 16 | return None |
---|
| 17 | |
---|
| 18 | try: |
---|
| 19 | from Products.zdb import set_trace |
---|
| 20 | except: |
---|
| 21 | def set_trace(): |
---|
| 22 | pass |
---|
| 23 | import logging |
---|
| 24 | logger = logging.getLogger('Skins.getSchoolFeePrefix') |
---|
| 25 | |
---|
| 26 | student_id = context.getStudentId() |
---|
[3329] | 27 | student_record = context.students_catalog(id=student_id)[0] |
---|
[3060] | 28 | res = context.portal_catalog(portal_type="Certificate", |
---|
[3329] | 29 | id = student_record.course) |
---|
| 30 | |
---|
| 31 | |
---|
[3060] | 32 | if not res: |
---|
| 33 | logger.info('%s, certificate %s not found' % (student_id,course)) |
---|
| 34 | prefix = "--" |
---|
| 35 | else: |
---|
| 36 | prefix = res[0].getObject().getContent().school_fee_code |
---|
| 37 | if not prefix or prefix == 'none': |
---|
| 38 | prefix = res[0].getPath().split('/')[-4] |
---|
[3329] | 39 | if student_record.review_state == 'cleared_and_validated': |
---|
| 40 | prefix = prefix + 'NEW' |
---|
[3060] | 41 | return prefix |
---|
Note: See
TracBrowser for help on using the repository browser.