474
473
schema = IBugTrackerComponent
475
custom_widget('sourcepackagename',
476
UbuntuSourcePackageNameWidget)
474
custom_widget('sourcepackagename', UbuntuSourcePackageNameWidget)
479
477
def page_title(self):
528
526
sourcepackagename = self.request.form.get(
529
527
self.widgets['sourcepackagename'].name)
531
distro_name = self.widgets['sourcepackagename'].distribution_name
532
distribution = getUtility(IDistributionSet).getByName(distro_name)
529
distribution = self.widgets['sourcepackagename'].getDistribution()
533
530
pkg = distribution.getSourcePackage(sourcepackagename)
534
531
bug_tracker = self.context.component_group.bug_tracker
536
533
# Has this source package already been assigned to a component?
537
534
link_comp = bug_tracker.getRemoteComponentForDistroSourcePackage(
538
distro_name, sourcepackagename)
535
distribution.name, sourcepackagename)
539
536
if link_comp is not None:
540
537
self.request.response.addNotification(
541
538
"The %s source package is already linked to %s:%s in %s" % (
542
539
sourcepackagename, link_comp.component_group.name,
543
link_comp.name, distro_name))
540
link_comp.name, distribution.name))
546
543
component.distro_source_package = pkg
547
544
self.request.response.addNotification(
548
545
"%s:%s is now linked to the %s source package in %s" % (
549
546
component.component_group.name, component.name,
550
sourcepackagename, distro_name))
547
sourcepackagename, distribution.name))
552
549
@action('Save Changes', name='save')
553
550
def save_action(self, action, data):