Changeset 12168 for main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Timestamp:
- 8 Dec 2014, 06:17:30 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba/documents
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/document.py
r12161 r12168 87 87 return 88 88 89 @property 90 def is_verifiable(self): 91 return True, None 92 89 93 def setMD5(self): 90 94 """Determine md5 checksum of all files and store checksums as -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/interfaces.py
r12161 r12168 53 53 user_id = Attribute('Id of a user') 54 54 connected_files = Attribute('Names of files connected to a document') 55 is_verifiable = Attribute('Contract verifiable by officer') 55 56 56 57 title = schema.TextLine( -
main/waeup.ikoba/trunk/src/waeup/ikoba/documents/workflow.py
r12162 r12168 22 22 from zope.component import getUtility 23 23 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 24 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 24 from hurry.workflow.interfaces import ( 25 IWorkflowState, IWorkflowTransitionEvent, InvalidTransitionError) 25 26 from waeup.ikoba.interfaces import ( 26 27 IObjectHistory, IIkobaWorkflowInfo, … … 128 129 """Append message to document history and log file and update 129 130 last_transition_date when transition happened. 131 132 Undo the verification of document and raise an exception if document 133 does not meet the requirements for verification. 130 134 """ 135 if event.transition.destination == VERIFIED: 136 verifiable, error = obj.is_verifiable 137 if not verifiable: 138 # Undo transition and raise an exception. 139 IWorkflowState(obj).setState(event.transition.source) 140 raise InvalidTransitionError(error) 131 141 if event.transition.transition_id == 'verify': 132 142 obj.setMD5()
Note: See TracChangeset for help on using the changeset viewer.