-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use get_registered_model to load User model in Django 1.7
In Django 1.7, get_user_model fails if the app cache isn't ready. As we have to use it in many places in Oscar, this commit essentially loads the User model like we load any other model in Oscar. This circumvents the check for the model registry being ready. Otherwise, there's major problems trying to avoid imports that trigger the call to get_user_model (e.g. in forms and test factories) before the first model is loaded (which then triggers Django's app load sequence).
- Loading branch information
1 parent
80aa5a7
commit 37361b2
Showing
1 changed file
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters