Merge lp://staging/~sinzui/launchpad/apply-commercial-subscriptins-1 into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 16351
Proposed branch: lp://staging/~sinzui/launchpad/apply-commercial-subscriptins-1
Merge into: lp://staging/launchpad
Diff against target: 254 lines (+83/-67)
4 files modified
lib/lp/registry/browser/configure.zcml (+1/-1)
lib/lp/registry/browser/person.py (+3/-1)
lib/lp/registry/browser/tests/test_commercialsubscription.py (+69/-65)
lib/lp/security.py (+10/-0)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/apply-commercial-subscriptins-1
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+138761@code.staging.launchpad.net

Commit message

Allow commercial admins to apply commercial subscription vouchers for users.

Description of the change

Users are confused that buying a commercial subscription does not apply
it to their commercial project. Commercial Admins often quiz both the
buyer and ask Lp Admins to confirm the user has vouchers that can be
applied to a commercial project.

RULES

    Pre-implementation: czajkowski
    * Allow Commercial Admins to view another user's vouchers and apply them
      to the user's projects.

    Next branch
    * Show a link to the +vouchers page when the user has commercial
      subscription vouchers.
    * Show a link to the user's +voucher page when the user has
      commercial subscription vouchers and the project page says it
      needs a renewed commercial subscription.

QA

    As a CA
    * Visit https://qastaging.launchpad.net/~mrevell/+vouchers
      or https://qastaging.launchpad.net/~bac/+vouchers
    * Verify you can see they have vouchers and that you can apply one.

LINT

    lib/lp/security.py
    lib/lp/registry/browser/configure.zcml
    lib/lp/registry/browser/person.py
    lib/lp/registry/browser/tests/test_commercialsubscription.py

LoC

    I have more than 10,000 lines of credit this week.

TEST

    ./bin/test -vvc -t PersonVouchersViewTestCase -t vouchers lp.registry

IMPLEMENTATION

I added a security checker for IPerson and launchpad.Commercial, then
updated the view to ensure there was no change for users. I then added
tests and made one small adjustment to the view to Verify that commercial
admins could see and apply another user's vouchers. I removed a lot ot
duplication in the viuew tests.
    lib/lp/security.py
    lib/lp/registry/browser/configure.zcml
    lib/lp/registry/browser/person.py
    lib/lp/registry/browser/tests/test_commercialsubscription.py

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) :
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.