Changeset 9295 for main/waeup.kofa/trunk


Ignore:
Timestamp:
4 Oct 2012, 20:40:29 (12 years ago)
Author:
Henrik Bettermann
Message:

Set validation_date and validated_by in study level objects when importing verdicts.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r9293 r9295  
    2727import csv
    2828from time import time
     29from datetime import datetime
    2930from zope.interface import Interface
    3031from zope.schema import getFields
     
    762763        if obj.__parent__.state == REGISTERED:
    763764            IWorkflowInfo(obj.__parent__).fireTransition('bypass_validation')
     765            obj[level_string].validated_by = _('System')
     766            obj[level_string].validation_date = datetime.utcnow()
    764767        else:
    765768            IWorkflowInfo(obj.__parent__).fireTransition('return')
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py

    r9294 r9295  
    988988        student = self.processor.getParent(
    989989            dict(matric_number='100005'), self.app)
    990         self.assertEqual(studycourse.current_verdict, '0')
    991990        self.assertEqual(student.state, 'returning')
     991        self.assertEqual(student['studycourse'].current_verdict, 'A')
    992992        self.assertEqual(studycourse.current_level, 200)
     993        self.assertEqual(student['studycourse']['200'].validated_by, 'System')
     994        self.assertTrue(isinstance(
     995            student['studycourse']['200'].validation_date, datetime.datetime))
    993996        content = open(fail_file).read()
    994997        self.assertEqual(
  • main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py

    r9284 r9295  
    166166        transition_id = 'bypass_validation',
    167167        title = _('Return and bypass validation'),
    168         msg = _("Returned"),
     168        msg = _("Course validation bypassed"),
    169169        source = REGISTERED,
    170170        destination = RETURNING),
Note: See TracChangeset for help on using the changeset viewer.