Changeset 3236 for WAeUP_SRP/base/skins


Ignore:
Timestamp:
26 Feb 2008, 16:54:44 (17 years ago)
Author:
joachim
Message:

implement getAccessInfo in interswitch_cb totally untested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/skins/waeup_epayment/interswitch_cb.py

    r3232 r3236  
    2121from AccessControl import Unauthorized
    2222import DateTime
     23
    2324if context.portal_membership.isAnonymousUser():
    2425    return None
     
    3031member = mtool.getAuthenticatedMember()
    3132member_id = str(member)
    32 student_id = context.getStudentId()
     33#student_id = context.getStudentId()
     34access_info = context.waeup_tool.getAccessInfo(context)
     35student_id = access_info['student_id']
    3336if student_id is None: # or student_id != member_id:
    3437    logger.info('%s tried to access payment object of %s' % (member_id,student_id))
     
    7275    #    wftool.doActionFor(context,'close')
    7376    return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
    74 try:
    75     context.getContent().edit(mapping = pd)
    76 except:
    77     logger.info('%s tried to edit payment %s in state %s' % (student_id,
    78                                                              context.getId(),
    79                                                              review_state))
    80     return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
     77if access_info['is_student'] and review_state == 'closed':
     78    wftool.doActionFor(context,'open')
     79context.getContent().edit(mapping = pd)
     80# except:
     81#     logger.info('%s tried to edit payment %s in state %s' % (student_id,
     82#                                                              context.getId(),
     83#                                                              review_state))
     84#     return request.RESPONSE.redirect("%s/waeup_document_view" % context.absolute_url())
    8185
    8286resp = pd['resp_code']
     
    122126else:
    123127    logger.info('%s received unsuccessfull callback: %s' % (student_id,pd['resp_desc']))
    124 try:
     128if review_state == 'opened':
    125129    wftool.doActionFor(context,'close')
    126 except:
    127     logger.info('%s no workflow action close' % student_id)
    128130
    129131
Note: See TracChangeset for help on using the changeset viewer.