Code review comment for lp:~deryck/launchpad/bug-description-fixes-opera-414755

Revision history for this message
Barry Warsaw (barry) wrote :

> Bug 414755 reports a problem with the inline description editing widget
> not working properly in Opera. This branch disables the editor widget
> for Opera (for now) because the fix could be quite involved.

Could you perhaps update the bug with some thoughts about how you'd go about
fixing this in the future? I have but don't use Opera, but it's still a
bummer to have to disable this.

> = Launchpad lint =
>
> Checking for conflicts. and issues in doctests and templates.
> Running jslint, xmllint, pyflakes, and pylint.
> Using normal rules.
>
> Linting changed files:
> lib/canonical/widgets/lazrjs.py
>
>
> == Pylint notices ==
>
> lib/canonical/widgets/lazrjs.py
> 352: [W0102, vocabulary_to_choice_edit_items] Dangerous default
> value [] as argument

This isn't your code, but here's a suggested change in case you want to clean this up while you're here.

=== modified file 'lib/canonical/widgets/lazrjs.py'
--- lib/canonical/widgets/lazrjs.py 2009-08-10 21:05:33 +0000
+++ lib/canonical/widgets/lazrjs.py 2009-08-21 19:27:50 +0000
@@ -348,7 +348,7 @@

 def vocabulary_to_choice_edit_items(
- vocab, css_class_prefix=None, disabled_items=[], as_json=False,
+ vocab, css_class_prefix=None, disabled_items=None, as_json=False,
     name_fn=None, value_fn=None):
     """Convert an enumerable to JSON for a ChoiceEdit.

@@ -359,6 +359,8 @@
     :name_fn: A function receiving an item and returning its name.
     :value_fn: A function receiving an item and returning its value.
     """
+ if disabled_items is None:
+ disabled_items = []
     items = []
     for item in vocab:
         if name_fn is not None:

review: Approve (code)

« Back to merge proposal