3559
def _allow_multipillar_private_bugs(self):
3560
""" Some teams still need to have multi pillar private bugs."""
3561
return bool(getFeatureFlag(
3562
'disclosure.allow_multipillar_private_bugs.enabled'))
3564
def canAddProjectTask(self):
3565
"""Can a new bug task on a project be added to this bug?
3567
If a bug has any bug tasks already, were it to be private, it cannot
3568
be marked as also affecting any other project, so return False.
3570
Note: this check is currently only relevant if a bug is private.
3571
Eventually, even public bugs will have this restriction too. So what
3572
happens now is that this API is used by the tales to add a class
3573
called 'disallow-private' to the Also Affects Project link. A css rule
3574
is used to hide the link when body.private is True.
3578
if self._allow_multipillar_private_bugs:
3580
return len(bug.bugtasks) == 0
3582
def canAddPackageTask(self):
3583
"""Can a new bug task on a src pkg be added to this bug?
3585
If a bug has any existing bug tasks on a project, were it to
3586
be private, then it cannot be marked as affecting a package,
3589
A task on a given package may still be illegal to add, but
3590
this will be caught when bug.addTask() is attempted.
3592
Note: this check is currently only relevant if a bug is private.
3593
Eventually, even public bugs will have this restriction too. So what
3594
happens now is that this API is used by the tales to add a class
3595
called 'disallow-private' to the Also Affects Package link. A css rule
3596
is used to hide the link when body.private is True.
3599
if self._allow_multipillar_private_bugs:
3601
for pillar in bug.affected_pillars:
3602
if IProduct.providedBy(pillar):
3559
3607
class BugTaskTableRowView(LaunchpadView, BugTaskBugWatchMixin):
3560
3608
"""Browser class for rendering a bugtask row on the bug page."""