← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-migrate-old-upstream-status into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-migrate-old-upstream-status into launchpad:master.

Commit message:
Fix BugTaskSearchListingView._migrateOldUpstreamStatus for Python 3

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/398891

Attempting to test membership of a list in a dict raises TypeError on Python 3.  Add an explicit type check first.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-migrate-old-upstream-status into launchpad:master.
diff --git a/lib/lp/bugs/browser/buglisting.py b/lib/lp/bugs/browser/buglisting.py
index 6acbf8a..9a4a3c9 100644
--- a/lib/lp/bugs/browser/buglisting.py
+++ b/lib/lp/bugs/browser/buglisting.py
@@ -1189,7 +1189,8 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
             'only_resolved_upstream': 'resolved_upstream'}
 
         status_upstream = self.request.get('field.status_upstream')
-        if status_upstream in old_upstream_status_values_to_new_values.keys():
+        if (not isinstance(status_upstream, list) and
+                status_upstream in old_upstream_status_values_to_new_values):
             self.request.form['field.status_upstream'] = [
                 old_upstream_status_values_to_new_values[status_upstream]]
         elif status_upstream == '':