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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: ea90f9cc9c423700b3f8e84d9114b1a93ce2e418
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-migrate-old-upstream-status
Merge into: launchpad:master
Diff against target: 14 lines (+2/-1)
1 file modified
lib/lp/bugs/browser/ (+2/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email:

Commit message

Fix BugTaskSearchListingView._migrateOldUpstreamStatus for Python 3

Description of the change

Attempting to test membership of a list in a dict raises TypeError on Python 3. Add an explicit type check first.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/bugs/browser/ b/lib/lp/bugs/browser/
2index 6acbf8a..9a4a3c9 100644
3--- a/lib/lp/bugs/browser/
4+++ b/lib/lp/bugs/browser/
5@@ -1189,7 +1189,8 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin):
6 'only_resolved_upstream': 'resolved_upstream'}
8 status_upstream = self.request.get('field.status_upstream')
9- if status_upstream in old_upstream_status_values_to_new_values.keys():
10+ if (not isinstance(status_upstream, list) and
11+ status_upstream in old_upstream_status_values_to_new_values):
12 self.request.form['field.status_upstream'] = [
13 old_upstream_status_values_to_new_values[status_upstream]]
14 elif status_upstream == '':


People subscribed via source and target branches

to status/vote changes: