Ignore:
Timestamp:
28 Mar 2007, 02:35:25 (18 years ago)
Author:
uli
Message:

Incorporated changeset 1593:1652 of trunk into uli-branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/branches/uli/skins/waeup_student/delete_course_result.py

    r1593 r1653  
    1414
    1515from Products.CMFCore.utils import getToolByName
     16from AccessControl import Unauthorized
     17
    1618here = context
    1719from urllib import urlencode
     
    3032            real_ids.append(id)
    3133    if real_ids:
    32         context.manage_delObjects(real_ids)
    33         logger.info('%s deleted StudentCourseResult object %s' % (member,id))
    34         message = 'psm_item(s)_deleted'
     34        try:
     35            context.manage_delObjects(real_ids)
     36            logger.info('%s deleted StudentCourseResult object %s for %s' % (member,id,context.getStudentId()))
     37            message = 'psm_item(s)_deleted'
     38        except Unauthorized:
     39            logger.info('%s has no permission to delete StudentCourseResult objects for %s' % (member,context.getStudentId()))
     40            message = 'no item(s) deleted'
    3541else:
    3642    message = 'psm_select_at_least_one_document'
    37    
     43
    3844args = {}
    3945args['portal_status_message'] = message
    40 url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     46
     47if action_after_validate:
     48    url = context.absolute_url() + '/' + action_after_validate + '?' + urlencode(args)
     49else:
     50    url = context.absolute_url() + '?' + urlencode(args)
    4151if REQUEST is not None:
    42     return REQUEST.RESPONSE.redirect(url)   
     52    return REQUEST.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.