You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
angela-tran opened this issue
Apr 9, 2024
· 2 comments
· Fixed by #2152
Assignees
Labels
back-endDjango views, sessions, middleware, models, migrations etc.choreChores and tasks for code cleanup, dev experience, admin/configuration settings, etc.
Should we be worried about this / look into it further? What can go wrong if "the app registry has not been fully populated" / what does that even mean?
Exceptions from misconfiguration of AuthProviders could also be swallowed by the way the code works right now, and the fix to this ticket would also fix that
back-endDjango views, sessions, middleware, models, migrations etc.choreChores and tasks for code cleanup, dev experience, admin/configuration settings, etc.
Looking into this a little further, I found some Django docs that correspond with the
RuntimeWarning
we're seeing. This section warns against interacting with the database inAppConfig.ready()
:Our
OAuthAppConfig
interacts with the database by querying for allAuthProvider
s.The "Application intialization process" documentation describes how the app registry gets populated and why "premature database queries are discouraged": https://docs.djangoproject.com/en/5.0/ref/applications/#initialization-process
But I'm not sure if there's a better place for us to register our Authlib configurations.
Maybe we should register each
AuthProvider
's configuration upon the first attempt to actually use it?Originally posted by @angela-tran in #1809 (comment)
The text was updated successfully, but these errors were encountered: