- Timestamp:
- 20 Jun 2011, 00:30:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/accesscodes/accesscodes.py
r6408 r6413 6 6 from BTrees.OIBTree import OIBTree 7 7 from datetime import datetime 8 from hurry.workflow.interfaces import IWorkflowInfo, InvalidTransitionError 8 from hurry.workflow.interfaces import ( 9 IWorkflowInfo, InvalidTransitionError, IWorkflowState) 9 10 from random import SystemRandom as random 10 11 from waeup.sirp.interfaces import IWAeUPSIRPPluggable … … 12 13 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer 13 14 ) 14 from waeup.sirp.accesscodes.workflow import DISABLED 15 from waeup.sirp.accesscodes.workflow import DISABLED, USED 15 16 16 17 class ManageACBatches(grok.Permission): … … 51 52 return None 52 53 return self.batch.cost 54 55 @property 56 def disabled(self): 57 return IWorkflowState(self).getState() == DISABLED 58 59 @property 60 def used(self): 61 return IWorkflowState(self).getState() == USED 53 62 54 63 class AccessCodeBatch(grok.Model): … … 454 463 meanings. 455 464 """ 456 ac = get_access_code(access_code) 457 if ac: 458 info = IWorkflowInfo(ac) 459 return _fire_transition(info, 'use') 460 else: 461 False 465 return fire_transition(access_code, 'use') 462 466 463 467 def disable_accesscode(access_code):
Note: See TracChangeset for help on using the changeset viewer.