Merge lp:~gmb/launchpad/filter-on-bug-creation-bug-720147 into lp:launchpad

Proposed by Graham Binns
Status: Merged
Merged at revision: 12967
Proposed branch: lp:~gmb/launchpad/filter-on-bug-creation-bug-720147
Merge into: lp:launchpad
Prerequisite: lp:~bac/launchpad/bug-720147
Diff against target: 27 lines (+3/-4)
1 file modified
lib/lp/bugs/model/bug.py (+3/-4)
To merge this branch: bzr merge lp:~gmb/launchpad/filter-on-bug-creation-bug-720147
Reviewer Review Type Date Requested Status
Benji York (community) code Approve
Review via email: mp+59772@code.launchpad.net

Commit message

[r=benji][ui=none] [r=benji][bug=720147] Users that have BugSubscriptionFilters on bug status and importance should no longer receive creation notifications about bugs that don't match those filters.

Description of the change

This branch fixes the test failures encountered in lp:~bac/launchpad/bug-720147. These failures occurred because our tests rely on the internal API allowing them to set initial BugTask statuses without any permission checks. Whilst this is probably a bit silly it's safeguarded by the WS API and the LP UI, so I see no harm in reverting the change here for the time being.

To post a comment you must log in.
Revision history for this message
Benji York (benji) wrote :

Looks good.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/model/bug.py'
2--- lib/lp/bugs/model/bug.py 2011-05-03 12:46:08 +0000
3+++ lib/lp/bugs/model/bug.py 2011-05-03 12:46:11 +0000
4@@ -2443,20 +2443,19 @@
5 # Create the task on a product if one was passed.
6 if params.product:
7 getUtility(IBugTaskSet).createTask(
8- bug=bug, product=params.product, owner=params.owner)
9+ bug=bug, product=params.product, owner=params.owner,
10+ status=params.status)
11
12 # Create the task on a source package name if one was passed.
13 if params.distribution:
14 getUtility(IBugTaskSet).createTask(
15 bug=bug, distribution=params.distribution,
16 sourcepackagename=params.sourcepackagename,
17- owner=params.owner)
18+ owner=params.owner, status=params.status)
19
20 bug_task = bug.default_bugtask
21 if params.assignee:
22 bug_task.transitionToAssignee(params.assignee)
23- if params.status:
24- bug_task.transitionToStatus(params.status, params.owner)
25 if params.importance:
26 bug_task.transitionToImportance(params.importance, params.owner)
27 if params.milestone: