Commits

Anonymous committed b051a4c

Fix the private yes/no dropdown.

LinkHTMLProperty treats a false value as missing, so if we try to do a
comparison python tries to access __eq__ on the Link object, and because the
base class defines only __cmp__, the Link object __getattr__ is called nand
returns a MissingValue that the __eq__ is look up on, and things go south.

But, we can use 'not', because that calls __nonzero__, which is defined on the
base class.

Comments (0)

Files changed (1)

html/query.edit.html

   <select tal:attributes="name string:query${query/id}@private_for">
    <option tal:attributes="selected python:query.private_for == uid;
            value uid" i18n:translate="">yes</option>
-   <option tal:attributes="selected python:query.private_for == None"
+   <option tal:attributes="selected python:not query.private_for"
            value="-1" i18n:translate="">no</option>
   </select>
  </td>