common/mixins.py
changeset 465 1158231e7360
parent 441 49e4717e2371
child 471 9dc392f05c65
equal deleted inserted replaced
464:75d242975792 465:1158231e7360
   163     """
   163     """
   164     __implements__ = (IWorkflowable,)
   164     __implements__ = (IWorkflowable,)
   165     
   165     
   166     @property
   166     @property
   167     def state(self):
   167     def state(self):
   168         return self.in_state[0].name
   168         try:
       
   169             return self.in_state[0].name
       
   170         except IndexError:
       
   171             self.warning('entity %s has no state', self)
       
   172             return None
   169     
   173     
   170     @property
   174     @property
   171     def displayable_state(self):
   175     def displayable_state(self):
   172         return self.req._(self.state)
   176         return self.req._(self.state)
   173 
   177