~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Steve Kowalik
  • Date: 2012-01-03 00:28:55 UTC
  • mto: This revision was merged to the branch mainline in revision 14619.
  • Revision ID: steve.kowalik@canonical.com-20120103002855-chx8gsly13dabse4
Only add packaging if distribution.currentseries is not None.

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