Changeset 3818 for WAeUP_SRP/trunk/skins


Ignore:
Timestamp:
15 Dec 2008, 15:31:55 (16 years ago)
Author:
Henrik Bettermann
Message:

lecturer_course_edit.py: resolve ticket Schools #2, member_id must be identical with lecturer_id of course

customize getLecturerCourseResults.py and lecturer_students_list.pt

Location:
WAeUP_SRP/trunk/skins
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/trunk/skins/waeup_student/lecturer_course_edit.py

    r3786 r3818  
    99# $Id: course_edit.py 1071 2006-12-16 15:53:13Z joachim $
    1010"""
    11 This method is for demonstration purposes only.
    12 There is noi security to deter lecturers from editing courses they are not allowed to edit.
    1311"""
    1412try:
     
    3432requested_id = context.getStudentId()
    3533if not 'Lecturers' in groups and not context.isSectionOfficer():
    36     logger.info('%s tried to access course result of %s' % (member_id,requested_id))
     34    logger.info('%s tried to access course result of %s but is not a lecturer' % (member_id,requested_id))
    3735    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
    3836
     
    4846mode = 'edit'
    4947object = {}
    50 course = course_results[0]
     48course_result = course_results[0]
     49course = context.courses_catalog(code=course_id)[0]
     50lecturer_id = getattr(course,'lecturer',None)
     51#set_trace()
     52if str(lecturer_id) != member_id:
     53    logger.info('%s tried to access course result %s of %s but is not a lecturer of this course' % (member_id,course_id,requested_id))
     54    return REQUEST.RESPONSE.redirect("%s/srp_anonymous_view" % context.portal_url())
     55
    5156for field in context.course_results.schema():
    52     object[field] = getattr(course,field,None)
     57    object[field] = getattr(course_result,field,None)
    5358    if repr(object[field]) == 'Missing.Value':
    5459        object[field] = None
    55 #set_trace()     
     60     
    5661lt = context.portal_layouts
    5762res,psm, ds = lt.renderLayout(schema_id = 'student_course_result',
Note: See TracChangeset for help on using the changeset viewer.