Connect widget signals during RB initialization instead of module load.

Review Request #6370 — Created Sept. 24, 2014 and submitted

Information

Review Board
release-2.0.x
67f9a0b...

Reviewers

reviewboard/admin/__init__.py was connecting to save/delete signals for
Repository and Group in order to invalidate widget caches, in order to
keep the dashboard up-to-date. However, doing it during module load
resulted in some circular import issues, which manifested in various
ways over time, but are now impacting the docs generation.

Now, the signal connections and invalidation live solely in widgets.py,
in an init_widgets() function.

The top-level reviewboard.admin module listens for Review Board's
initializing signal and, when called, it invokes the init_widgets().

This allows us to build docs again, and should resolve some of the other
cases we've seen over time.

Unit tests pass.

Added some logging to _increment_sync_num, and saw it was being called
when I saved or deleted groups and repositories.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/__init__.py
        reviewboard/admin/widgets.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/admin/__init__.py
        reviewboard/admin/widgets.py
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-2.0.x (bec1424)
Loading...