~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/bugalsoaffects.py

[r=wgrant][bug=810727] Do not create packaging links in
        BugAlsoAffectsView if the distribution we get from the DSP task
        on the bugtask has no currentseries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
663
663
        if data.get('add_packaging', False):
664
664
            # Create a packaging link so that Launchpad will suggest the
665
665
            # upstream project to the user.
666
 
            packaging_util = getUtility(IPackagingUtil)
667
 
            packaging_util.createPackaging(
668
 
                productseries=data['product'].development_focus,
669
 
                sourcepackagename=self.context.target.sourcepackagename,
670
 
                distroseries=self.context.target.distribution.currentseries,
671
 
                packaging=PackagingType.PRIME, owner=self.user)
 
666
            series = self.context.target.distribution.currentseries
 
667
            if series:
 
668
                getUtility(IPackagingUtil).createPackaging(
 
669
                    productseries=data['product'].development_focus,
 
670
                    sourcepackagename=self.context.target.sourcepackagename,
 
671
                    distroseries=series, packaging=PackagingType.PRIME,
 
672
                    owner=self.user)
672
673
        return super(ProductBugTaskCreationStep, self).main_action(data)
673
674
 
674
675
    @property