Merge lp://staging/~gmb/launchpad/team-subscription-opt-out-apis into lp://staging/launchpad/db-devel

Proposed by Graham Binns
Status: Merged
Merged at revision: 10392
Proposed branch: lp://staging/~gmb/launchpad/team-subscription-opt-out-apis
Merge into: lp://staging/launchpad/db-devel
Prerequisite: lp://staging/~gmb/launchpad/team-subscription-opt-out
Diff against target: 285 lines (+193/-5)
4 files modified
lib/lp/bugs/configure.zcml (+3/-1)
lib/lp/bugs/interfaces/bugsubscriptionfilter.py (+41/-3)
lib/lp/bugs/model/bugsubscriptionfilter.py (+39/-0)
lib/lp/bugs/tests/test_structuralsubscription.py (+110/-1)
To merge this branch: bzr merge lp://staging/~gmb/launchpad/team-subscription-opt-out-apis
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+55982@code.staging.launchpad.net

Commit message

[r=bac][ui=none][bug=751173] APIs have been added to IBugSubscriptionFilter to allow for muting and unmuting of subscriptions. These have also been exposed in the devel API.

Description of the change

This branch adds APIs around the BugSubscriptionFilterMute model. The APIs added are:

 - BugSubscriptionFilter.isMuteAllowed(person):
   Returns True if `person` can add a mute for the current filter.
 - BugSubscriptionFilter.mute(person):
   Add a mute for `person` and return it. If called for a user who is already
   muted, return the existing mute. Raise an error if isMuteAllowed() would
   return False for `person`.
 - BugSubscriptionFilter.unmute(person):
   Remove any mutes for `person` on the current Filter.

I've added tests to cover these APIs.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Graham this branch looks great and is quite thorough. I like your idempotent tests.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: