Add LocalSite compatibility for NavigationBarHook.is_enabled_for.

Review Request #7626 — Created Sept. 13, 2015 and submitted

Information

Review Board
release-2.0.x

Reviewers

NavigationBarHook.is_enabled_for only took a user as a parameter, which
meant that the hook couldn't easily differentiate between LocalSites
without subclassing.

Now, is_enabled_for is 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.

Description From Last Updated

Single quotes.

daviddavid

Single quotes.

daviddavid
reviewbot
  1. 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
    
    
  2. 
      
david
  1. 
      
  2. reviewboard/extensions/tests.py (Diff revision 1)
     
     
     
    Show all issues

    Single quotes.

  3. reviewboard/extensions/tests.py (Diff revision 1)
     
     
     
    Show all issues

    Single quotes.

  4. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (3255fa7)
Loading...