Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#446 closed defect (fixed)

[patch] bug in yesno filter prevents usage of 2-value form

Reported by: hugo <gb@…> Owned by: Adrian Holovaty
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


When using the yesno filter with only 2 values, it does the decomposition wrong and will set yes to a list instead of a value. this patch fixes that:

---   (revision 585)
+++   (working copy)
@@ -368,7 +368,8 @@
         yes, no, maybe = bits
     except ValueError: # unpack list of wrong size (no "maybe" value provided)
-        yes, no, maybe = bits, bits[1], bits[1]
+        yes, no = bits
+       maybe = no
     if value is None:
         return maybe
     if value:

Change History (2)

comment:1 Changed 13 years ago by hugo <gb@…>

attention: a tab crept in and the "maybe = no" line should be indented one more blank to make sense. Sorry :-/

comment:2 Changed 13 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

Fixed in [589].

Note: See TracTickets for help on using tickets.
Back to Top