tolerate missing (probably deleted) task when editing work item
This commit is contained in:
parent
f3d595a974
commit
0ca62cbe91
1 changed files with 8 additions and 4 deletions
|
@ -43,6 +43,7 @@ from loops.browser.concept import ConceptView
|
||||||
from loops.browser.form import ObjectForm, EditObject
|
from loops.browser.form import ObjectForm, EditObject
|
||||||
from loops.browser.node import NodeView
|
from loops.browser.node import NodeView
|
||||||
from loops.common import adapted
|
from loops.common import adapted
|
||||||
|
from loops.interfaces import IConcept
|
||||||
from loops.organize.interfaces import IPerson
|
from loops.organize.interfaces import IPerson
|
||||||
from loops.organize.party import getPersonForUser
|
from loops.organize.party import getPersonForUser
|
||||||
from loops.organize.stateful.browser import StateAction
|
from loops.organize.stateful.browser import StateAction
|
||||||
|
@ -410,10 +411,11 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
||||||
task = self.task
|
task = self.task
|
||||||
if task is None:
|
if task is None:
|
||||||
task = self.target
|
task = self.target
|
||||||
options = IOptions(adapted(task.conceptType))
|
if IConcept.providedBy(task):
|
||||||
typeNames = options.workitem_types
|
options = IOptions(adapted(task.conceptType))
|
||||||
if typeNames:
|
typeNames = options.workitem_types
|
||||||
return [workItemTypes[name] for name in typeNames]
|
if typeNames:
|
||||||
|
return [workItemTypes[name] for name in typeNames]
|
||||||
return workItemTypes
|
return workItemTypes
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
|
@ -483,6 +485,8 @@ class CreateWorkItemForm(ObjectForm, BaseTrackView):
|
||||||
task = self.task
|
task = self.task
|
||||||
if task is None:
|
if task is None:
|
||||||
task = self.target
|
task = self.target
|
||||||
|
if not IConcept.providedBy(task):
|
||||||
|
return []
|
||||||
options = IOptions(adapted(task.conceptType))
|
options = IOptions(adapted(task.conceptType))
|
||||||
return options.hidden_workitem_actions or []
|
return options.hidden_workitem_actions or []
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue