- Timestamp:
- 4 Oct 2012, 05:38:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r9282 r9284 35 35 from waeup.kofa.interfaces import ( 36 36 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 37 IObjectHistory, VALIDATED, IGNORE_MARKER)37 IObjectHistory, VALIDATED, REGISTERED, IGNORE_MARKER) 38 38 from waeup.kofa.interfaces import MessageFactory as _ 39 39 from waeup.kofa.students.interfaces import ( … … 717 717 factory_name = 'waeup.StudentStudyCourse' 718 718 719 additional_fields = ['current_session', 'current_level'] 719 additional_fields = [ 720 'current_session', 721 'current_level', 722 'bypass_validation'] 720 723 721 724 def checkUpdateRequirements(self, obj, row, site): … … 729 732 if obj.current_session != row['current_session']: 730 733 return 'Current session does not correspond.' 731 # Check if student is in state REGISTERED732 if obj.student.state != VALIDATED:733 return 'Student in wrong state.'734 734 # Check if new verdict is provided 735 735 if row['current_verdict'] in (IGNORE_MARKER, ''): 736 736 return 'Verdict is missing.' 737 # Check if student is in state REGISTERED or VALIDATED 738 if row.get('bypass_validation') in ('1', 'True', 'TRUE', 'yes'): 739 if obj.student.state not in (VALIDATED, REGISTERED): 740 return 'Student in wrong state.' 741 else: 742 if obj.student.state != VALIDATED: 743 return 'Student in wrong state.' 737 744 return None 738 745 … … 749 756 '%s - Verdict updated: %s' 750 757 % (parent.student_id, items_changed)) 751 # Fire transition 752 IWorkflowInfo(obj.__parent__).fireTransition('return') 758 # Fire transition depending on student's state 759 if obj.__parent__.state == REGISTERED: 760 IWorkflowInfo(obj.__parent__).fireTransition('bypass_validation') 761 else: 762 IWorkflowInfo(obj.__parent__).fireTransition('return') 753 763 # Update the students_catalog 754 764 notify(grok.ObjectModifiedEvent(obj.__parent__))
Note: See TracChangeset for help on using the changeset viewer.