Code review comment for lp:~deryck/launchpad/hot-bugtasks-to-hot-bugs-442170

Revision history for this message
Deryck Hodge (deryck) wrote :

I believe I've fixed everything now. Latest incremental diff:

=== modified file 'lib/lp/bugs/browser/bugtarget.py'
--- lib/lp/bugs/browser/bugtarget.py 2010-01-20 18:27:12 +0000
+++ lib/lp/bugs/browser/bugtarget.py 2010-01-21 17:51:36 +0000
@@ -1264,12 +1264,13 @@
         hot_bugs = []
         count = 0
         for task in bugtasks:
- if task.bug not in hot_bugs:
+ # Ensure we only represent a bug once in the list.
+ if task.bug not in [hot_task.bug for hot_task in hot_bugs]:
                 if count < 10:
- hot_bugs.append(task.bug)
+ hot_bugs.append(task)
                     count += 1
- elif count == 10:
- return hot_bugs
+ else:
+ break
         return hot_bugs

=== modified file 'lib/lp/bugs/model/bugtask.py'
--- lib/lp/bugs/model/bugtask.py 2010-01-19 22:34:00 +0000
+++ lib/lp/bugs/model/bugtask.py 2010-01-21 20:45:05 +0000
@@ -1257,7 +1257,7 @@
         "number_of_duplicates": "Bug.number_of_duplicates",
         "message_count": "Bug.message_count",
         "users_affected_count": "Bug.users_affected_count",
- "heat": "Bug.hotness",
+ "heat": "Bug.heat",
         }

     _open_resolved_upstream = """

=== modified file 'lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt'
--- lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2010-01-20 20:52:20 +0000
+++ lib/lp/bugs/stories/bugs/xx-product-bugs-page.txt 2010-01-21 17:56:06 +0000
@@ -203,8 +203,8 @@
     #21 Summary for new bug 6 New Undecided ...

-Fix released bugs are not shown. We demonstrate this by setting the bugtask
-for bug 18 to be "Fix released".
+Fix Released bugs are not shown. We demonstrate this by setting the bugtask
+for bug 18 to be "Fix Released".

     >>> from lp.bugs.interfaces.bug import BugTaskStatus, IBugSet
     >>> from lp.registry.interfaces.person import IPersonSet
@@ -215,7 +215,7 @@
     ... BugTaskStatus.FIXRELEASED, project_owner)
     >>> logout()

-And then reloading the page. The Fix released bug, bug 18, is no longer shown.
+And then reloading the page. The Fix Released bug, bug 18, is no longer shown.

     >>> anon_browser.reload()
     >>> print extract_text(

=== modified file 'lib/lp/bugs/templates/bugtarget-bugs.pt'
--- lib/lp/bugs/templates/bugtarget-bugs.pt 2010-01-20 18:16:50 +0000
+++ lib/lp/bugs/templates/bugtarget-bugs.pt 2010-01-21 17:33:54 +0000
@@ -113,23 +113,23 @@
           </tr>
         </thead>
         <tbody>
- <tr tal:repeat="bug view/hot_bugs">
+ <tr tal:repeat="bugtask view/hot_bugs">
             <td class="icon left">
               <img alt="" src="/@@/bug" />
             </td>
             <td style="text-align: right">
- #<span tal:replace="bug/default_bugtask/bug/id" />
+ #<span tal:replace="bugtask/bug/id" />
             </td>
             <td>
- <a tal:attributes="href bug/default_bugtask/fmt:url"
- tal:content="bug/default_bugtask/bug/title" />
+ <a tal:attributes="href bugtask/fmt:url"
+ tal:content="bugtask/bug/title" />
             </td>
- <td tal:attributes="class string:status${bug/default_bugtask/status/name}"
- tal:content="bug/default_bugtask/status/title" />
+ <td tal:attributes="class string:status${bugtask/status/name}"
+ tal:content="bugtask/status/title" />
             <td tal:attributes="
- class string:importance${bug/default_bugtask/importance/name}"
- tal:content="bug/default_bugtask/importance/title" />
- <td tal:content="bug/default_bugtask/bug/date_last_updated/fmt:displaydate" />
+ class string:importance${bugtask/importance/name}"
+ tal:content="bugtask/importance/title" />
+ <td tal:content="bugtask/bug/date_last_updated/fmt:displaydate" />
           </tr>
         </tbody>
       </table>

« Back to merge proposal