fix running work items: stop only if of type 'work'

This commit is contained in:
Helmut Merz 2015-03-21 17:10:10 +01:00
parent 0aeb854014
commit 3d3013b76c

View file

@ -295,10 +295,14 @@ class WorkItem(Stateful, Track):
def doStart(self, userName, **kw):
action = 'start'
# stop any running work item of user:
if self.state != 'running':
# TODO: check: party query OK?
if (userName == self.userName and
self.workItemType == 'work' and
self.state != 'running'):
running = getParent(self).query(
party=userName, state='running')
for wi in running:
if wi.workItemType == 'work':
wi.doAction('work', userName,
end=(kw.get('start') or getTimeStamp()))
# standard creation of new work item: