Changeset 4754 for waeup/branches/ulif-layout
- Timestamp:
- 9 Jan 2010, 11:11:51 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-layout/src/waeup/university/certificate.py
r4736 r4754 29 29 self.max_pass = max_pass 30 30 # Initialize workflow state... 31 self.setReviewState(' init')31 self.setReviewState('unchecked') 32 32 33 33 def check(self): … … 39 39 return IWorkflowState(self).getState() 40 40 41 def setReviewState(self, transition_id='check'): 41 def setReviewState(self, state=None): 42 """Try to set new state. 43 44 Instead of simply setting a value, we fire a transition of a 45 workflow. This might fail if, for instance, the required state 46 is not part of the workflow or unreachable from current state. 47 """ 48 if state == self.getReviewState(): 49 # Accept staying in the same state, even if workflow does 50 # not allow this. 51 return 42 52 info = IWorkflowInfo(self) 43 info.fireTransition (transition_id)53 info.fireTransitionToward(state) 44 54 return 45 55 56 review_state = property(getReviewState, setReviewState) 57 46 58 def addCourseRef(self, course, level=100, core_or_elective=True): 47 59 """Add a course reference. … … 66 78 return 67 79 68 review_state = property(getReviewState, setReviewState) 80 69 81 70 82
Note: See TracChangeset for help on using the changeset viewer.