128
128
from lp.app.browser.tales import DateTimeFormatterAPI
129
129
from lp.app.interfaces.launchpad import ILaunchpadCelebrities
130
130
from lp.blueprints.interfaces.specification import ISpecification
131
from lp.bugs.interfaces.bugtask import (
134
IDistroSeriesBugTask,
135
IProductSeriesBugTask,
131
from lp.bugs.interfaces.bugtask import IBugTask
138
132
from lp.registry.interfaces.distribution import IDistribution
139
133
from lp.registry.interfaces.distributionsourcepackage import (
140
134
IDistributionSourcePackage,
1459
1453
def getMilestoneTarget(milestone_context):
1460
1454
"""Return the milestone target."""
1461
if IUpstreamBugTask.providedBy(milestone_context):
1462
target = milestone_context.product
1463
elif IDistroBugTask.providedBy(milestone_context):
1464
target = milestone_context.distribution
1465
elif IDistroSeriesBugTask.providedBy(milestone_context):
1466
target = milestone_context.distroseries
1467
elif IProductSeriesBugTask.providedBy(milestone_context):
1468
target = milestone_context.productseries.product
1455
if IBugTask.providedBy(milestone_context):
1456
bug_target = milestone_context.target
1457
if IProduct.providedBy(bug_target):
1458
target = milestone_context.product
1459
elif IProductSeries.providedBy(bug_target):
1460
target = milestone_context.productseries.product
1461
elif (IDistribution.providedBy(bug_target) or
1462
IDistributionSourcePackage.providedBy(bug_target)):
1463
target = milestone_context.distribution
1464
elif (IDistroSeries.providedBy(bug_target) or
1465
ISourcePackage.providedBy(bug_target)):
1466
target = milestone_context.distroseries
1469
1467
elif IDistributionSourcePackage.providedBy(milestone_context):
1470
1468
target = milestone_context.distribution
1471
1469
elif ISourcePackage.providedBy(milestone_context):