Move and reorganize LocalSite and OAuth2 signal handlers.
Review Request #12299 — Created May 24, 2022 and submitted
reviewboard.sitehad previously started listening to signals in two
- The top-level
reviewboard.sitemodule, for managing OAuth2
reviewboard.models, for triggering a
The OAuth2 one probably shouldn't be in this app, and in fact it also
listens to a signal (
initializing) to set up webapi scopes.
Since this is a mess, and more signal handlers will soon be coming as
part of another change, this change takes the opportunity to clean this
reviewboard.oauth.signal_handlersmodules have been added, each with a
The one in
reviewboard.sitesets up the trigger for the
The one in
reviewboard.oauthsets up the application access management
and enables scope.
Both apps now have an
apps.py, which calls
connect_to_signal_handlers()when the app is ready. This means we're
not setting up on
initializing, which currently happens on first HTTP
request. Instead, we're setting up when the app is ready, meaning we can
be better prepared before HTTP requests are handled.
Unit tests pass.
- Added a missing module docstring.
- Fixed a typo in a docstring.
Revision 2 (+364 -246)
Checks run (2 succeeded)