← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/derivedistroseries-name-is-not-special into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/derivedistroseries-name-is-not-special into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/derivedistroseries-name-is-not-special/+merge/52511

Distroseries names are unique per Distribution but overall the set of
Distribution-Distroseries is, so look for that instead.
-- 
https://code.launchpad.net/~stevenk/launchpad/derivedistroseries-name-is-not-special/+merge/52511
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/derivedistroseries-name-is-not-special into lp:launchpad.
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py	2011-03-04 04:28:07 +0000
+++ lib/lp/registry/model/distroseries.py	2011-03-08 04:58:56 +0000
@@ -1886,10 +1886,11 @@
         # or the child.parent's drivers.
         if not (user.inTeam('soyuz-team') or user.inTeam('admins')):
             raise Unauthorized
-        child = IStore(self).find(DistroSeries, name=name).one()
+        if distribution is None:
+            distribution = self.distribution
+        child = IStore(self).find(
+            DistroSeries, name=name, distribution=distribution).one()
         if child is None:
-            if distribution is None:
-                distribution = self.distribution
             if not displayname:
                 raise DerivationError(
                     "Display Name needs to be set when creating a "