launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #02919
[Merge] lp:~jml/launchpad/reported-by-me-121646 into lp:launchpad
Jonathan Lange has proposed merging lp:~jml/launchpad/reported-by-me-121646 into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #121646 in Launchpad itself: "Lack link to "Bugs reported by me" for a context"
https://bugs.launchpad.net/launchpad/+bug/121646
For more details, see:
https://code.launchpad.net/~jml/launchpad/reported-by-me-121646/+merge/51148
Braindead fix for bug 121646 - have a link to bugs reported by me. Ignores the "affects me" feature for now, makes no attempt to clean up tech debt in this area, and doesn't actually add unit tests.
But hey, it works.
--
https://code.launchpad.net/~jml/launchpad/reported-by-me-121646/+merge/51148
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jml/launchpad/reported-by-me-121646 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bugtask.py'
--- lib/lp/bugs/browser/bugtask.py 2011-03-07 02:50:50 +0000
+++ lib/lp/bugs/browser/bugtask.py 2011-03-10 17:10:43 +0000
@@ -49,7 +49,6 @@
timedelta,
)
from itertools import (
- chain,
groupby,
)
from math import (
@@ -1877,6 +1876,13 @@
else:
return get_buglisting_search_filter_url(assignee=self.user.name)
+ @property
+ def my_reported_bugs_url(self):
+ """A URL to a list of bugs reported by the user, or None."""
+ if self.user is None:
+ return None
+ return get_buglisting_search_filter_url(bug_reporter=self.user.name)
+
class BugsStatsMixin(BugsInfoMixin):
"""Contains properties giving bug stats.
@@ -1965,6 +1971,15 @@
return self.context.searchTasks(params).count()
@property
+ def my_reported_bugs_count(self):
+ """A count of bugs reported by the user, or None."""
+ if self.user is None:
+ return None
+ params = get_default_search_params(self.user)
+ params.bug_reporter = self.user
+ return self.context.searchTasks(params).count()
+
+ @property
def bugs_with_patches_count(self):
"""A count of unresolved bugs with patches."""
return self.context.searchTasks(
@@ -1983,7 +1998,7 @@
def get_buglisting_search_filter_url(
assignee=None, importance=None, status=None, status_upstream=None,
- has_patches=None):
+ has_patches=None, bug_reporter=None):
"""Return the given URL with the search parameters specified."""
search_params = []
@@ -1997,6 +2012,8 @@
search_params.append(('field.status_upstream', status_upstream))
if has_patches is not None:
search_params.append(('field.has_patch', 'on'))
+ if bug_reporter is not None:
+ search_params.append(('field.bug_reporter', bug_reporter))
query_string = urllib.urlencode(search_params, doseq=True)
=== modified file 'lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt'
--- lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2010-04-16 12:40:34 +0000
+++ lib/lp/bugs/stories/xx-bugs-statistics-portlet.txt 2011-03-10 17:10:43 +0000
@@ -40,8 +40,8 @@
0 Bugs fixed elsewhere
2 Open CVE bugs - CVE reports
-Once the user has identified him or herself, information on assigned
-bugs is also shown.
+Once the user has identified themselves, show information on assigned and
+reported bugs.
>>> print_bugfilters_portlet_unfilled(user_browser, path)
New bugs
@@ -51,6 +51,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs - CVE reports
@@ -65,6 +66,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
2 Open CVE bugs - CVE reports
@@ -108,8 +110,8 @@
0 Bugs fixed elsewhere
1 Open CVE bug - CVE report
-Once the user has identified him or herself, information on assigned
-bugs is also shown.
+Once the user has identified themselves, show information on assigned and
+reported bugs.
>>> print_bugfilters_portlet_unfilled(user_browser, path)
New bugs
@@ -119,6 +121,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs - CVE reports
@@ -135,6 +138,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
1 Open CVE bug - CVE report
@@ -175,8 +179,8 @@
0 Bugs fixed elsewhere
2 Open CVE bugs
-Once the user has identified him or herself, information on assigned
-bugs is also shown.
+Once the user has identified themselves, show information on assigned and
+reported bugs.
>>> print_bugfilters_portlet_unfilled(user_browser, path)
New bugs
@@ -186,6 +190,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs
@@ -200,6 +205,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
2 Open CVE bugs
@@ -242,8 +248,8 @@
0 Bugs fixed elsewhere
1 Open CVE bug
-Once the user has identified him or herself, information on assigned
-bugs is also shown.
+Once the user has identified themselves, show information on assigned and
+reported bugs.
>>> print_bugfilters_portlet_unfilled(user_browser, path)
New bugs
@@ -253,6 +259,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs
@@ -265,6 +272,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
1 Open CVE bug
@@ -308,8 +316,8 @@
0 Bugs fixed elsewhere
1 Open CVE bug
-Once the user has identified him or herself, information on assigned
-bugs is also shown.
+Once the user has identified themselves, show information on assigned
+and reported bugs.
>>> print_bugfilters_portlet_unfilled(user_browser, path)
New bugs
@@ -319,6 +327,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs
@@ -333,6 +342,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
1 Open CVE bug
@@ -387,6 +397,7 @@
High importance bugs
<BLANKLINE>
Bugs assigned to me
+ Bugs reported by me
Bugs with patches
Bugs fixed elsewhere
Open CVE bugs - CVE reports
@@ -401,6 +412,7 @@
0 High importance bugs
<BLANKLINE>
0 Bugs assigned to me
+ 0 Bugs reported by me
0 Bugs with patches
0 Bugs fixed elsewhere
1 Open CVE bug - CVE report
=== modified file 'lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt'
--- lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2010-04-14 18:43:21 +0000
+++ lib/lp/bugs/templates/bugtarget-portlet-bugfilters-content.pt 2011-03-10 17:10:43 +0000
@@ -83,6 +83,17 @@
</a>
</td>
</tr>
+ <tr tal:condition="view/user"
+ tal:define="count view/my_reported_bugs_count|nothing;
+ plural string: Bugs reported by me;
+ singular string: Bug reported by me;">
+ <td class="bugs-count" tal:content="count" />
+ <td class="bugs-link">
+ <a tal:attributes="href string:${view/my_reported_bugs_url}">
+ <metal:message use-macro="context/@@+base-layout-macros/plural-message"/>
+ </a>
+ </td>
+ </tr>
<tr tal:define="count view/bugs_with_patches_count|nothing;
plural string: Bugs with patches;
singular string: Bug with a patch;">
Follow ups