Connect widget signals during RB initialization instead of module load.
Review Request #6370 — Created Sept. 24, 2014 and submitted
reviewboard/admin/__init__.py
was connecting to save/delete signals for
Repository
andGroup
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 aninit_widgets()
function.The top-level
reviewboard.admin
module listens for Review Board's
initializing
signal and, when called, it invokes theinit_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.