[1.7] Allow Review UIs to decide whether they're usable on a case-by-case basis.
Review Request #6007 — Created June 17, 2014 and submitted
ReviewUI
subclaseses can now define ais_enabled_for()
function, which
returns whether it can be enabled for the given user, review request,
and/or file attachment. This allows, for instance, limiting a review UI
based onextra_data
on an object, or based on the given user or
Local Site, or anything else.
Tested this with a file attachment returning True, and then returning False.
Implemented a custom version and tested by file attachment name.
- Change Summary:
-
- Updated the
is_enabled_for
docs to describe the expectations when being called. - Added default arguments for all keyword arguments, indicating they should be used as keyword arguments and not positional.
- Updated the
- Commit:
-
33718878fe60a8e926f4dd291d70ca991ab213f4ade64f4cfd13c1d61324e7ceda7a255dda637e2a
-
Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/reviews/ui/base.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/review_request_box.html Tool: PEP8 Style Checker Processed Files: reviewboard/reviews/views.py reviewboard/reviews/ui/base.py reviewboard/reviews/templatetags/reviewtags.py Ignored Files: reviewboard/templates/reviews/review_request_box.html