Changeset 3036 for WAeUP_SRP/base


Ignore:
Timestamp:
23 Jan 2008, 10:02:33 (17 years ago)
Author:
joachim
Message:

fix mass_edit_verdict, add wf-transition

File:
1 edited

Legend:

Unmodified
Added
Removed
  • WAeUP_SRP/base/WAeUPTool.py

    r3033 r3036  
    19361936            if matric_no and student_record.matric_no and\
    19371937              matric_no != student_record.matric_no:
    1938                 logger.info("%s, old matric_no %s overwritten with %s" % (student_record.id,student_record.matric_no,matric_no))
     1938                return '', 'student %s matric_no %s does not match %s' % (student_record.id,
     1939                                                                          student_record.matric_no,
     1940                                                                          matric_no)
    19391941        elif matric_no:
    19401942            res = self.students_catalog(matric_no = matric_no)
     
    19461948        student_id = student_record.id
    19471949        student_review_state =  student_record.review_state
    1948         if student_review_state not in ('courses_validated',):
     1950        if student_review_state not in ('courses_validated','returning'):
    19491951            return '',"student %s in wrong review_state %s" % (student_id, student_review_state)
    19501952        student_obj = getattr(students_folder,student_id)
     
    19651967                                                                                    current_level,
    19661968                                                                                    student_record.level)
    1967         sub_obj = getattr(student_obj,'study_course',None)
    1968         if sub_obj is None:
     1969        study_course_obj = getattr(student_obj,'study_course',None)
     1970        if study_course_obj is None:
    19691971            return '','student_id %s: no study_course-object' % student_id
    1970         level_obj = getattr(sub_obj,current_level,None)
     1972        level_obj = getattr(study_course_obj,current_level,None)
    19711973        if  level_obj is None:
    19721974            return '','student_id %s: no study_level-object for level %s' % (student_id,
    19731975                                                                             current_level)
    1974         verdict = d['verdict'] = mapping.get('current_verdict','')
     1976        verdict = d['verdict'] = d['current_verdict'] = mapping.get('current_verdict','')
    19751977        if verdict == student_record.verdict:
    19761978            return '','student_id %s: verdict already set to %s' % (student_id,
     
    19821984                                                                 current_level)
    19831985       
     1986        study_course_obj.getContent().edit(mapping = d)
    19841987        level_obj.getContent().edit(mapping = d)
     1988        if student_review_state != "returning":
     1989            wftool.doActionFor(student_obj,'return')
    19851990        try:
    19861991            wftool.doActionFor(level_obj,'close')
Note: See TracChangeset for help on using the changeset viewer.