launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #04478
[Merge] lp:~rvb/launchpad/bug-820900 into lp:launchpad
Raphael Victor Badin has proposed merging lp:~rvb/launchpad/bug-820900 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #820900 in Launchpad itself: "KeyError: u'ignored' in +localpackagediffs"
https://bugs.launchpad.net/launchpad/+bug/820900
For more details, see:
https://code.launchpad.net/~rvb/launchpad/bug-820900/+merge/70434
This branch fixes an oops when the filtering key passed to +localpackagediffs is not a valid key). In this case we just use the default filter key.
= Tests =
./bin/test -vvc test_distroserie test_batch_wrong_param
= QA =
This page should not oops anymore (note the field.package_type=RANDOM):
https://dogfood.launchpad.net/ubuntu/oneiric/+localpackagediffs?field.name_filter=&field.package_type=RANDOM&field.package_type-empty-marker=1
--
https://code.launchpad.net/~rvb/launchpad/bug-820900/+merge/70434
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/launchpad/bug-820900 into lp:launchpad.
=== modified file 'lib/lp/registry/browser/distroseries.py'
--- lib/lp/registry/browser/distroseries.py 2011-08-01 20:25:28 +0000
+++ lib/lp/registry/browser/distroseries.py 2011-08-04 13:03:35 +0000
@@ -1078,7 +1078,10 @@
ALL: DistroSeriesDifferenceStatus.items,
}
- status = package_type_dsd_status[self.specified_package_type]
+ # Get the right status or the default status.
+ status = package_type_dsd_status.get(
+ self.specified_package_type,
+ package_type_dsd_status.get(DEFAULT_PACKAGE_TYPE))
child_version_higher = (
self.specified_package_type == HIGHER_VERSION_THAN_PARENT)
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2011-07-29 20:05:40 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2011-08-04 13:03:35 +0000
@@ -1637,6 +1637,20 @@
self.assertContentEqual(diffs, all_view.cached_differences.batch)
+ def test_batch_wrong_param(self):
+ # If a wrong parameter is passed, then the default is used.
+ set_derived_series_ui_feature_flag(self)
+ derived_series, parent_series = self._createChildAndParent()
+ diff1 = self.factory.makeDistroSeriesDifference(
+ derived_series=derived_series,
+ source_package_name_str="my-src-package")
+ view = create_initialized_view(
+ derived_series,
+ '+localpackagediffs',
+ query_string='field.package_type=%s' % 'unexpected')
+
+ self.assertContentEqual([diff1], view.cached_differences.batch)
+
def test_batch_blacklisted_differences_with_higher_version(self):
# field.package_type parameter allows to list only
# blacklisted differences with a child's version higher than parent's.
Follow ups