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/buglisting.py (+2/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+398891@code.launchpad.net

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
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):
1189 'only_resolved_upstream': 'resolved_upstream'}1189 'only_resolved_upstream': 'resolved_upstream'}
11901190
1191 status_upstream = self.request.get('field.status_upstream')1191 status_upstream = self.request.get('field.status_upstream')
1192 if status_upstream in old_upstream_status_values_to_new_values.keys():1192 if (not isinstance(status_upstream, list) and
1193 status_upstream in old_upstream_status_values_to_new_values):
1193 self.request.form['field.status_upstream'] = [1194 self.request.form['field.status_upstream'] = [
1194 old_upstream_status_values_to_new_values[status_upstream]]1195 old_upstream_status_values_to_new_values[status_upstream]]
1195 elif status_upstream == '':1196 elif status_upstream == '':

Subscribers

People subscribed via source and target branches

to status/vote changes: