Last change
on this file since 2193 was
2180,
checked in by Henrik Bettermann, 17 years ago
|
tested and fixed
enable editing of payment objects
|
File size:
1.0 KB
|
Line | |
---|
1 | ## Script (Python) "changeState" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=REQUEST,transition=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: epayment_cb.py 1348 2007-01-25 17:06:21Z henrik $ |
---|
11 | """ |
---|
12 | execute transition |
---|
13 | """ |
---|
14 | |
---|
15 | mtool = context.portal_membership |
---|
16 | member = mtool.getAuthenticatedMember() |
---|
17 | if str(member) not in ('admin','joachim') or transition is None: |
---|
18 | return |
---|
19 | |
---|
20 | import logging |
---|
21 | logger = logging.getLogger('Skins.changeState') |
---|
22 | |
---|
23 | pm = context.portal_membership |
---|
24 | member = pm.getAuthenticatedMember() |
---|
25 | |
---|
26 | request = context.REQUEST |
---|
27 | students = context.portal_url.getPortalObject().campus.students |
---|
28 | wftool = context.portal_workflow |
---|
29 | student_id = context.getStudentId() |
---|
30 | if student_id is None: |
---|
31 | return context.REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
32 | |
---|
33 | student = getattr(students,student_id) |
---|
34 | |
---|
35 | wftool.doActionFor(student,transition) |
---|
36 | logger.info('%s executes transition %s for %s' % (member,transition,student_id)) |
---|
37 | |
---|
38 | return request.RESPONSE.redirect("%s" % context.absolute_url()) |
---|
Note: See
TracBrowser for help on using the repository browser.