Add LocalSite compatibility for NavigationBarHook.is_enabled_for.
Review Request #7626 — Created Sept. 13, 2015 and submitted
NavigationBarHook.is_enabled_foronly took a user as a parameter, which
meant that the hook couldn't easily differentiate between LocalSites
without subclassing.Now,
is_enabled_foris meant to take keyword arguments, and will be
passed the user, request, and the LocalSite name. Older implementations
that only take a user are still supported, but a warning will be shown.
Unit tests pass.
Used this in an extension that needed to know the LocalSite, and checked
that it worked both with and without the new function signatures.
Tool: Pyflakes Processed Files: reviewboard/extensions/hooks.py reviewboard/extensions/tests.py Tool: PEP8 Style Checker Processed Files: reviewboard/extensions/hooks.py reviewboard/extensions/tests.py