Fix the admin site only showing OAuth-related models
Review Request #9058 — Created July 7, 2017 and submitted — Latest diff uploaded
We were accidentally importing the
reviewboard.oauth.admin
module too
early, causingadmin.autodiscover()
to never be called (because we had
already registered ourApplication
model). This was leading to only
oauth2_provider
andreviewboard.oauth
models being shown in the
admin site DB page. Importing the admin in a function scope fixes this
issue.
With this patch applied, models get registered correctly.