launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04320
[Merge] lp:~wgrant/launchpad/unuse-bugtask-markers into lp:launchpad
William Grant has proposed merging lp:~wgrant/launchpad/unuse-bugtask-markers into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #80902 in Launchpad itself: "Can't target bug report from project to distribution, or vice versa"
https://bugs.launchpad.net/launchpad/+bug/80902
For more details, see:
https://code.launchpad.net/~wgrant/launchpad/unuse-bugtask-markers/+merge/68636
This branch begins the elimination of IUpstreamBugTask, IDistroBugTask, IDistroSeriesBugTask and IProductSeriesBugTask. They're fairly silly marker interfaces on top of IBugTask, which serve little purpose. I've replaced most of the uses with direct attribute or target interface checks.
--
https://code.launchpad.net/~wgrant/launchpad/unuse-bugtask-markers/+merge/68636
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/unuse-bugtask-markers into lp:launchpad.
=== modified file 'lib/canonical/launchpad/doc/canonical_url_examples.txt'
--- lib/canonical/launchpad/doc/canonical_url_examples.txt 2011-05-27 19:53:20 +0000
+++ lib/canonical/launchpad/doc/canonical_url_examples.txt 2011-07-21 07:22:36 +0000
@@ -188,7 +188,7 @@
>>> canonical_url(getUtility(IBugSet).get(1))
u'http://bugs.launchpad.dev/bugs/1'
-An IUpstreamBugTask.
+An IBugTask on a product.
>>> canonical_url(getUtility(IBugTaskSet).get(2))
u'http://bugs.launchpad.dev/firefox/+bug/1'
@@ -203,13 +203,13 @@
>>> canonical_url(getUtility(IQuestionSet).get(6).messages[0])
u'http://answers.launchpad.dev/firefox/+question/6/messages/1'
-An IDistroBugTask.
+An IBugTask on a distribution source package.
>>> distro_task = getUtility(IBugTaskSet).get(4)
>>> canonical_url(distro_task)
u'http://bugs.launchpad.dev/debian/+source/mozilla-firefox/+bug/1'
-An IDistroBugTask without a sourcepackage.
+An IBugTask on a distribution without a sourcepackage.
>>> from canonical.launchpad.ftests import login
>>> login("foo.bar@xxxxxxxxxxxxx")
@@ -220,13 +220,13 @@
u'http://bugs.launchpad.dev/debian/+bug/1'
>>> distro_task.sourcepackagename = temp_spname
-An IDistroSeriesBugTask.
+An IBugTask on a distribution series source package.
>>> distro_series_task = getUtility(IBugTaskSet).get(16)
>>> canonical_url(distro_series_task)
u'http://bugs.launchpad.dev/ubuntu/warty/+source/mozilla-firefox/+bug/5'
-An IDistroSeriesBugTask without a sourcepackage.
+An IBugTask on a distribution series without a sourcepackage.
>>> temp_spname = distro_series_task.sourcepackagename
>>> distro_series_task.sourcepackagename = None
=== modified file 'lib/canonical/launchpad/mail/helpers.py'
--- lib/canonical/launchpad/mail/helpers.py 2011-06-08 05:43:21 +0000
+++ lib/canonical/launchpad/mail/helpers.py 2011-07-21 07:22:36 +0000
@@ -11,11 +11,6 @@
from zope.component import getUtility
-from lp.bugs.interfaces.bugtask import (
- IDistroBugTask,
- IDistroSeriesBugTask,
- IUpstreamBugTask,
- )
from canonical.launchpad.interfaces.mail import (
EmailProcessingError,
IWeaklyAuthenticatedPrincipal,
@@ -50,49 +45,6 @@
return msg.get_payload(decode=True)
-def get_bugtask_type(bugtask):
- """Returns the specific IBugTask interface the bugtask provides.
-
- >>> from lp.bugs.interfaces.bugtask import (
- ... IUpstreamBugTask, IDistroBugTask, IDistroSeriesBugTask)
- >>> from zope.interface import classImplementsOnly
- >>> class BugTask:
- ... pass
-
- :bugtask: has to provide a specific bugtask interface:
-
- >>> get_bugtask_type(BugTask()) #doctest: +ELLIPSIS
- Traceback (most recent call last):
- ...
- AssertionError...
-
- When it does, the specific interface is returned:
-
- >>> classImplementsOnly(BugTask, IUpstreamBugTask)
- >>> get_bugtask_type(BugTask()) #doctest: +ELLIPSIS
- <...IUpstreamBugTask>
-
- >>> classImplementsOnly(BugTask, IDistroBugTask)
- >>> get_bugtask_type(BugTask()) #doctest: +ELLIPSIS
- <...IDistroBugTask>
-
- >>> classImplementsOnly(BugTask, IDistroSeriesBugTask)
- >>> get_bugtask_type(BugTask()) #doctest: +ELLIPSIS
- <...IDistroSeriesBugTask>
- """
- bugtask_interfaces = [
- IUpstreamBugTask,
- IDistroBugTask,
- IDistroSeriesBugTask,
- ]
- for interface in bugtask_interfaces:
- if interface.providedBy(bugtask):
- return interface
- # The bugtask didn't provide any specific interface.
- raise AssertionError(
- 'No specific bugtask interface was provided by %r' % bugtask)
-
-
def guess_bugtask(bug, person):
"""Guess which bug task the person intended to edit.
@@ -102,11 +54,11 @@
return bug.bugtasks[0]
else:
for bugtask in bug.bugtasks:
- if IUpstreamBugTask.providedBy(bugtask):
+ if bugtask.product:
# Is the person an upstream maintainer?
if person.inTeam(bugtask.product.owner):
return bugtask
- elif IDistroBugTask.providedBy(bugtask):
+ elif bugtask.distribution:
# Is the person a member of the distribution?
if person.inTeam(bugtask.distribution.members):
return bugtask
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2011-07-19 14:33:39 +0000
+++ lib/lp/bugs/browser/bugtask.py 2011-07-21 07:22:36 +0000
@@ -237,14 +237,10 @@
IBugTaskSearch,
IBugTaskSet,
ICreateQuestionFromBugTaskForm,
- IDistroBugTask,
- IDistroSeriesBugTask,
IFrontPageBugTaskSearch,
INominationsReviewTableBatchNavigator,
IPersonBugTaskSearch,
- IProductSeriesBugTask,
IRemoveQuestionFromBugTaskForm,
- IUpstreamBugTask,
IUpstreamProductBugTaskSearch,
UNRESOLVED_BUGTASK_STATUSES,
UserCannotEditBugTaskStatus,
@@ -720,15 +716,6 @@
series.bugtargetdisplayname)
self.request.response.redirect(canonical_url(self.context))
- def isSeriesTargetableContext(self):
- """Is the context something that supports Series targeting?
-
- Returns True or False.
- """
- return (
- IDistroBugTask.providedBy(self.context) or
- IDistroSeriesBugTask.providedBy(self.context))
-
@cachedproperty
def comments(self):
"""Return the bugtask's comments."""
@@ -1056,27 +1043,15 @@
keeping the field ids unique.
"""
parts = []
- if IUpstreamBugTask.providedBy(bugtask):
- parts.append(bugtask.product.name)
-
- elif IProductSeriesBugTask.providedBy(bugtask):
- parts.append(bugtask.productseries.name)
- parts.append(bugtask.productseries.product.name)
-
- elif IDistroBugTask.providedBy(bugtask):
- parts.append(bugtask.distribution.name)
- if bugtask.sourcepackagename is not None:
- parts.append(bugtask.sourcepackagename.name)
-
- elif IDistroSeriesBugTask.providedBy(bugtask):
- parts.append(bugtask.distroseries.distribution.name)
- parts.append(bugtask.distroseries.name)
-
- if bugtask.sourcepackagename is not None:
- parts.append(bugtask.sourcepackagename.name)
-
- else:
- raise AssertionError("Unknown IBugTask: %r" % bugtask)
+ parts.append(bugtask.pillar.name)
+
+ series = bugtask.productseries or bugtask.distroseries
+ if series:
+ parts.append(series.name)
+
+ if bugtask.sourcepackagename is not None:
+ parts.append(bugtask.sourcepackagename.name)
+
return '_'.join(parts)
@@ -1204,7 +1179,7 @@
editable_field_names.remove("importance")
else:
editable_field_names = set(('bugwatch', ))
- if not IUpstreamBugTask.providedBy(self.context):
+ if not IProduct.providedBy(self.context.target):
#XXX: Bjorn Tillenius 2006-03-01:
# Should be possible to edit the product as well,
# but that's harder due to complications with bug
@@ -1390,18 +1365,6 @@
"""
return self.context.userCanEditImportance(self.user)
- def _getProductOrDistro(self):
- """Return the product or distribution relevant to the context."""
- bugtask = self.context
- if IUpstreamBugTask.providedBy(bugtask):
- return bugtask.product
- elif IProductSeriesBugTask.providedBy(bugtask):
- return bugtask.productseries.product
- elif IDistroBugTask.providedBy(bugtask):
- return bugtask.distribution
- else:
- return bugtask.distroseries.distribution
-
def validate(self, data):
"""See `LaunchpadFormView`."""
bugtask = self.context
@@ -1467,8 +1430,7 @@
# be assigned to a milestone on a different product.
milestone_cleared = None
milestone_ignored = False
- if (IUpstreamBugTask.providedBy(bugtask) and
- (bugtask.product != new_values.get("product"))):
+ if bugtask.product and bugtask.product != new_values.get("product"):
# We clear the milestone value if one was already set. We ignore
# the milestone value if it was currently None, and the user tried
# to set a milestone value while also changing the product. This
@@ -1487,6 +1449,7 @@
# what it was!
data_to_apply.pop('milestone', None)
+
# We special case setting assignee and status, because there's
# a workflow associated with changes to these fields.
if "assignee" in data_to_apply:
@@ -1664,7 +1627,7 @@
field_names += ['milestone']
self.bugwatch_widget = None
- if not IUpstreamBugTask.providedBy(self.context):
+ if self.context.distroseries or self.context.distribution:
field_names += ['sourcepackagename']
self.assignee_widget = CustomWidgetFactory(AssigneeDisplayWidget)
@@ -3433,9 +3396,9 @@
Returns True or False.
"""
- bugtask = self.context
- return (IDistroSeriesBugTask.providedBy(bugtask) or
- IProductSeriesBugTask.providedBy(bugtask))
+ if self.context.productseries or self.context.distroseries:
+ return True
+ return False
def taskLink(self):
"""Return the proper link to the bugtask whether it's editable."""
@@ -3448,14 +3411,10 @@
def _getSeriesTargetNameHelper(self, bugtask):
"""Return the short name of bugtask's targeted series."""
- if IDistroSeriesBugTask.providedBy(bugtask):
- return bugtask.distroseries.name.capitalize()
- elif IProductSeriesBugTask.providedBy(bugtask):
- return bugtask.productseries.name.capitalize()
- else:
- assert (
- "Expected IDistroSeriesBugTask or IProductSeriesBugTask. "
- "Got: %r" % bugtask)
+ series = bugtask.distroseries or bugtask.productseries
+ if not series:
+ return None
+ return series.name.capitalize()
def getSeriesTargetName(self):
"""Get the series to which this task is targeted."""
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2011-06-17 10:31:55 +0000
+++ lib/lp/bugs/browser/configure.zcml 2011-07-21 07:22:36 +0000
@@ -635,9 +635,6 @@
class="lp.bugs.browser.bugtask.BugTaskView"
permission="launchpad.View"
template="../templates/bugtask-index.pt"/>
- <browser:defaultView
- for="lp.bugs.interfaces.bugtask.IUpstreamBugTask"
- name="+index"/>
<browser:page
name="+choose-affected-product"
for="lp.bugs.interfaces.bugtask.IBugTask"
@@ -655,26 +652,18 @@
class="lp.bugs.browser.bugalsoaffects.BugAlsoAffectsDistroMetaView"
permission="launchpad.AnyPerson"/>
<browser:page
- name="+edit-form"
- for="lp.bugs.interfaces.bugtask.IUpstreamBugTask"
- class="lp.bugs.browser.bugtask.BugTaskEditView"
- permission="launchpad.Edit"
- template="../templates/bugtask-edit-form.pt">
- </browser:page>
- <browser:page
- name="+edit-form"
- for="lp.bugs.interfaces.bugtask.IProductSeriesBugTask"
- class="lp.bugs.browser.bugtask.BugTaskEditView"
- permission="launchpad.Edit"
- template="../templates/bugtask-edit-form.pt">
- </browser:page>
- <browser:page
name="+editstatus"
for="lp.bugs.interfaces.bugtask.IBugTask"
class="lp.bugs.browser.bugtask.BugTaskEditView"
permission="launchpad.Edit"
template="../templates/bugtask-edit.pt"/>
<browser:page
+ name="+edit-form"
+ for="lp.bugs.interfaces.bugtask.IBugTask"
+ class="lp.bugs.browser.bugtask.BugTaskEditView"
+ permission="launchpad.Edit"
+ template="../templates/bugtask-edit-form.pt" />
+ <browser:page
name="+viewstatus"
for="lp.bugs.interfaces.bugtask.IBugTask"
class="lp.bugs.browser.bugtask.BugTaskStatusView"
@@ -686,26 +675,6 @@
class="lp.bugs.browser.bugtask.BugTaskListingView"
permission="launchpad.View">
</browser:page>
- <browser:defaultView
- for="lp.bugs.interfaces.bugtask.IDistroBugTask"
- name="+index"/>
- <browser:page
- name="+edit-form"
- for="lp.bugs.interfaces.bugtask.IDistroBugTask"
- class="lp.bugs.browser.bugtask.BugTaskEditView"
- permission="launchpad.Edit"
- template="../templates/bugtask-edit-form.pt">
- </browser:page>
- <browser:defaultView
- for="lp.bugs.interfaces.bugtask.IDistroSeriesBugTask"
- name="+index"/>
- <browser:page
- name="+edit-form"
- for="lp.bugs.interfaces.bugtask.IDistroSeriesBugTask"
- class="lp.bugs.browser.bugtask.BugTaskEditView"
- permission="launchpad.Edit"
- template="../templates/bugtask-edit-form.pt">
- </browser:page>
<browser:page
for="lp.bugs.interfaces.bugtask.IBugTask"
name="+create-question"
=== modified file 'lib/lp/bugs/browser/tests/bugtask-adding-views.txt'
--- lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2011-06-09 10:50:25 +0000
+++ lib/lp/bugs/browser/tests/bugtask-adding-views.txt 2011-07-21 07:22:36 +0000
@@ -558,22 +558,23 @@
IAddBugTaskForm Interface Definition
====================================
-IAddBugTaskForm, which is used as the schema for the views tested above, has
-some attributes which are identical to those of IUpstreamBugTask and
-IDistroBugTask. However, we must ensure that IAddBugTask defines its own
-attributes rather than borrowing those of IUpstreamBugTask and IDistroBugTask,
-since doing so has produced OOPSes (bug 129406).
+IAddBugTaskForm, which is used as the schema for the views tested above,
+has some attributes which are identical to those of IBugTask However, we
+must ensure that IAddBugTask defines its own attributes rather than
+borrowing those of IBugTask, since doing so has produced OOPSes (bug
+129406).
>>> from lp.bugs.interfaces.bugtask import (
- ... IAddBugTaskForm, IDistroBugTask, IUpstreamBugTask)
- >>> IAddBugTaskForm['product'] is IUpstreamBugTask['product']
- False
-
- >>> IAddBugTaskForm['distribution'] is IDistroBugTask['distribution']
- False
-
- >>> (IAddBugTaskForm['sourcepackagename'] is
- ... IDistroBugTask['sourcepackagename'])
+ ... IAddBugTaskForm,
+ ... IBugTask,
+ ... )
+ >>> IAddBugTaskForm['product'] is IBugTask['product']
+ False
+
+ >>> IAddBugTaskForm['distribution'] is IBugTask['distribution']
+ False
+
+ >>> IAddBugTaskForm['sourcepackagename'] is IBugTask['sourcepackagename']
False
=== modified file 'lib/lp/bugs/doc/bugtask-package-widget.txt'
--- lib/lp/bugs/doc/bugtask-package-widget.txt 2011-06-10 20:23:19 +0000
+++ lib/lp/bugs/doc/bugtask-package-widget.txt 2011-07-21 07:22:36 +0000
@@ -18,13 +18,13 @@
>>> from canonical.launchpad.webapp.servers import LaunchpadTestRequest
>>> from lp.bugs.interfaces.bug import IBugSet
- >>> from lp.bugs.interfaces.bugtask import IDistroBugTask
+ >>> from lp.bugs.interfaces.bugtask import IBugTask
>>> bug_one = getUtility(IBugSet).get(1)
>>> ubuntu_task = bug_one.bugtasks[-2]
>>> ubuntu_task.distribution.name
u'ubuntu'
- >>> package_field = IDistroBugTask['sourcepackagename'].bind(ubuntu_task)
+ >>> package_field = IBugTask['sourcepackagename'].bind(ubuntu_task)
>>> request = LaunchpadTestRequest(
... form={'field.sourcepackagename': 'evolution'})
@@ -63,7 +63,7 @@
At that point we'll fallback to the vocabulary, so a SourcePackageName
will still be returned.
- >>> package_field = IDistroBugTask['sourcepackagename'].bind(debian_task)
+ >>> package_field = IBugTask['sourcepackagename'].bind(debian_task)
>>> request = LaunchpadTestRequest(
... form={'field.sourcepackagename': 'evolution'})
>>> widget = BugTaskSourcePackageNameWidget(
=== modified file 'lib/lp/bugs/doc/bugtask.txt'
--- lib/lp/bugs/doc/bugtask.txt 2011-05-25 19:36:40 +0000
+++ lib/lp/bugs/doc/bugtask.txt 2011-07-21 07:22:36 +0000
@@ -63,10 +63,6 @@
>>> upstream_task.product == evolution
True
- >>> from lp.bugs.interfaces.bugtask import IUpstreamBugTask
- >>> IUpstreamBugTask.providedBy(upstream_task)
- True
-
ii. Distro -- a bug that has to be fixed in a specific distro
>>> ubuntu = distroset.get(1)
@@ -77,10 +73,6 @@
>>> distro_task.distribution == a_distro
True
- >>> from lp.bugs.interfaces.bugtask import IDistroBugTask
- >>> IDistroBugTask.providedBy(distro_task)
- True
-
ii. Distro Series -- a bug that has to be fixed in a specific distro
series. These tasks are used for release management and backporting.
@@ -91,20 +83,6 @@
>>> distro_series_task.distroseries == warty
True
- >>> from lp.bugs.interfaces.bugtask import IDistroSeriesBugTask
- >>> IDistroSeriesBugTask.providedBy(distro_series_task)
- True
-
-The created bugtasks are guaranteed to implement the correct interface.
-
- >>> from canonical.launchpad.webapp.testing import verifyObject
- >>> verifyObject(IDistroSeriesBugTask, distro_series_task)
- True
- >>> verifyObject(IDistroBugTask, distro_task)
- True
- >>> verifyObject(IUpstreamBugTask, upstream_task)
- True
-
# XXX: Brad Bollenbach 2005-02-24: See the bottom of this file for a chunk of
# test documentation that is missing from here, due to problems with resetting
# the connection after a ProgrammingError is raised. ARGH.
=== modified file 'lib/lp/bugs/model/tests/test_bugtask.py'
--- lib/lp/bugs/model/tests/test_bugtask.py 2011-07-19 14:42:52 +0000
+++ lib/lp/bugs/model/tests/test_bugtask.py 2011-07-21 07:22:36 +0000
@@ -31,7 +31,6 @@
BugTaskSearchParams,
BugTaskStatus,
IBugTaskSet,
- IUpstreamBugTask,
RESOLVED_BUGTASK_STATUSES,
UNRESOLVED_BUGTASK_STATUSES,
)
@@ -1156,7 +1155,7 @@
# Helper functions for the list comprehension below.
def _is_resolved_upstream_task(bugtask):
return (
- IUpstreamBugTask.providedBy(bugtask) and
+ bugtask.product is not None and
bugtask.status in resolved_upstream_states)
def _is_resolved_bugwatch_task(bugtask):
@@ -1192,7 +1191,7 @@
# Helper functions for the list comprehension below.
def _is_open_upstream_task(bugtask):
return (
- IUpstreamBugTask.providedBy(bugtask) and
+ bugtask.product is not None and
bugtask.status in open_states)
def _is_open_bugwatch_task(bugtask):
@@ -1216,7 +1215,7 @@
Returns True if yes, otherwise False.
"""
for bugtask in bug.bugtasks:
- if IUpstreamBugTask.providedBy(bugtask):
+ if bugtask.product is not None:
return True
return False
=== modified file 'lib/lp/bugs/stories/bugtask-management/xx-change-milestone.txt'
--- lib/lp/bugs/stories/bugtask-management/xx-change-milestone.txt 2011-07-19 10:17:47 +0000
+++ lib/lp/bugs/stories/bugtask-management/xx-change-milestone.txt 2011-07-21 07:22:36 +0000
@@ -58,7 +58,7 @@
are listed too.
>>> milestone_control = owner_browser.getControl(
- ... name='1.0_firefox.milestone')
+ ... name='firefox_1.0.milestone')
>>> milestone_control.displayValue
['(no value)']
>>> milestone_control.displayOptions
@@ -66,7 +66,7 @@
>>> milestone_control.displayValue = ['Mozilla Firefox 1.0.1']
>>> owner_browser.getControl('Save Changes', index=1).click()
>>> milestone_control = owner_browser.getControl(
- ... name='1.0_firefox.milestone')
+ ... name='firefox_1.0.milestone')
>>> milestone_control.displayValue
['Mozilla Firefox 1.0.1']
=== modified file 'lib/lp/bugs/subscribers/bugtask.py'
--- lib/lp/bugs/subscribers/bugtask.py 2011-03-21 20:27:13 +0000
+++ lib/lp/bugs/subscribers/bugtask.py 2011-07-21 07:22:36 +0000
@@ -11,12 +11,12 @@
from canonical.database.sqlbase import block_implicit_flushes
from canonical.launchpad.webapp.publisher import canonical_url
from lp.bugs.adapters.bugdelta import BugDelta
-from lp.bugs.interfaces.bugtask import IUpstreamBugTask
from lp.bugs.subscribers.bug import (
add_bug_change_notifications,
send_bug_details_to_new_bug_subscribers,
)
from lp.registry.interfaces.person import IPerson
+from lp.registry.interfaces.product import IProduct
@block_implicit_flushes
@@ -31,7 +31,7 @@
if event.object.bug.private:
return
- if not IUpstreamBugTask.providedBy(event.object):
+ if not IProduct.providedBy(event.object.target):
return
bugtask_before_modification = event.object_before_modification
=== modified file 'lib/lp/registry/vocabularies.py'
--- lib/lp/registry/vocabularies.py 2011-07-15 09:30:23 +0000
+++ lib/lp/registry/vocabularies.py 2011-07-21 07:22:36 +0000
@@ -128,13 +128,7 @@
from lp.app.browser.tales import DateTimeFormatterAPI
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
from lp.blueprints.interfaces.specification import ISpecification
-from lp.bugs.interfaces.bugtask import (
- IBugTask,
- IDistroBugTask,
- IDistroSeriesBugTask,
- IProductSeriesBugTask,
- IUpstreamBugTask,
- )
+from lp.bugs.interfaces.bugtask import IBugTask
from lp.registry.interfaces.distribution import IDistribution
from lp.registry.interfaces.distributionsourcepackage import (
IDistributionSourcePackage,
@@ -1458,14 +1452,18 @@
@staticmethod
def getMilestoneTarget(milestone_context):
"""Return the milestone target."""
- if IUpstreamBugTask.providedBy(milestone_context):
- target = milestone_context.product
- elif IDistroBugTask.providedBy(milestone_context):
- target = milestone_context.distribution
- elif IDistroSeriesBugTask.providedBy(milestone_context):
- target = milestone_context.distroseries
- elif IProductSeriesBugTask.providedBy(milestone_context):
- target = milestone_context.productseries.product
+ if IBugTask.providedBy(milestone_context):
+ bug_target = milestone_context.target
+ if IProduct.providedBy(bug_target):
+ target = milestone_context.product
+ elif IProductSeries.providedBy(bug_target):
+ target = milestone_context.productseries.product
+ elif (IDistribution.providedBy(bug_target) or
+ IDistributionSourcePackage.providedBy(bug_target)):
+ target = milestone_context.distribution
+ elif (IDistroSeries.providedBy(bug_target) or
+ ISourcePackage.providedBy(bug_target)):
+ target = milestone_context.distroseries
elif IDistributionSourcePackage.providedBy(milestone_context):
target = milestone_context.distribution
elif ISourcePackage.providedBy(milestone_context):