Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move get_user_model call out of method
The get_service_user method used to do a local call to the get_user_model function because it was not guaranteed to be properly initialized at the time of import. This was partly due to how we did custom initialization using lms/startup.py, but it was also because when it was implemented (commit f318661), the platform was still running on Django 1.8.18. At that time, get_user_model was guaranteed to work only after Django has imported all models. In Django 1.11, the behavior of get_user_model was changed: https://docs.djangoproject.com/en/1.11/releases/1.11/#django-contrib-auth > get_user_model() can now be called at import time, > even in modules that define models. Now that lms/startup.py is gone and get_user_model is safe to call at the module level, I'm refactoring the catalog app's models.py file to follow the convention we use everywhere else in edx-platform with respect to get_user_model.
- Loading branch information