Move and slight refactor @vouch_required

VERIFIED INVALID

Status

VERIFIED INVALID
7 years ago
6 years ago

People

(Reporter: jsocol, Unassigned)

Tracking

Details

(Whiteboard: [qa-])

(Reporter)

Description

7 years ago
We should do two things differently with the @vouch_required decorator:

1) Put it in something like phonebook.decorators. It doesn't need to live in phonebook.views.
2) The unvouched case should 'raise PermissionDenied', not return an HttpResponse subclass.

That'll let the 403 handler catch it.

Alternatively, we could subclass PermissionDenied:

    class VouchRequired(PermissionDenied):
        """A witty description."""

Then in a 403 handler view, do something slightly different for "you need a voucher" vs "you don't have permission to do that".
In bug 846039 we removed all related code. Marking this one  invalid.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → INVALID

Updated

6 years ago
Whiteboard: [qa-]
Resolving to verified invalid per comment 1.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.