← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~bryceharrington/launchpad/lp-646943-words-len into lp:launchpad/devel

 

Bryce Harrington has proposed merging lp:~bryceharrington/launchpad/lp-646943-words-len into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers): code
Related bugs:
  #646943 Bugzilla.convertRemoteImportance() OOPSes when there's no remote importance 
  https://bugs.launchpad.net/bugs/646943


Solves an oops in bugwatch (e.g. https://bugs.edge.launchpad.net/bugs/638789/+watch/81319)

It is apparently possible for upstream bugs to have an importance field but that is set to a blank string. This adds a simple check for this condition, and return the importance as 'unknown' in this case.
-- 
https://code.launchpad.net/~bryceharrington/launchpad/lp-646943-words-len/+merge/36585
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~bryceharrington/launchpad/lp-646943-words-len into lp:launchpad/devel.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py	2010-09-21 10:03:47 +0000
+++ lib/lp/bugs/browser/bugtask.py	2010-09-24 19:01:12 +0000
@@ -1579,7 +1579,7 @@
 
         if 'importance' not in read_only_field_names:
             # Users shouldn't be able to set a bugtask's importance to
-            # `UNKOWN`, only bug watches do that.
+            # `UNKNOWN`, only bug watches do that.
             importance_vocab_items = [
                 item for item in BugTaskImportance.items.items
                 if item != BugTaskImportance.UNKNOWN]

=== modified file 'lib/lp/bugs/externalbugtracker/bugzilla.py'
--- lib/lp/bugs/externalbugtracker/bugzilla.py	2010-08-25 20:04:40 +0000
+++ lib/lp/bugs/externalbugtracker/bugzilla.py	2010-09-24 19:01:12 +0000
@@ -242,7 +242,8 @@
         """See `ExternalBugTracker`."""
         try:
             words = remote_importance.lower().split()
-            return self._importance_lookup[words.pop()]
+            if len(words) > 0:
+                return self._importance_lookup[words.pop()]
 
         except KeyError:
             raise UnknownRemoteImportanceError(remote_importance)

=== modified file 'lib/lp/registry/stories/product/xx-product-files.txt'
--- lib/lp/registry/stories/product/xx-product-files.txt	2010-08-25 19:35:56 +0000
+++ lib/lp/registry/stories/product/xx-product-files.txt	2010-09-24 19:01:12 +0000
@@ -13,7 +13,7 @@
     Downloads
     APTonCD does not have any download files registered with Launchpad.
 
-Any user can see a project with a release without files has no downlaod files.
+Any user can see a project with a release without files has no download files.
 
     >>> anon_browser.open('http://launchpad.dev/thunderbird')
     >>> content = find_tag_by_id(anon_browser.contents, 'downloads')