Add a decorator that makes a view require a feature

Review Request #9007 — Created June 10, 2017 and submitted — Latest diff uploaded

Information

Djblets
release-0.10.x

Reviewers

The @feature_required(f) decorator makes the decorated view require
the f feature to be enabled to be executed. Otherwise a backup view
will be called, which by default returns a 404 Not Found error. This
view may be customized by the caller to return any sort of response.

  • Tested this with an upcoming patch for RB.
  • Ran unit tests.