Files
edx-platform/openedx/core
David Ormsbee d5aa834b6c 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.
2025-02-28 23:16:05 -05:00
..
2024-05-28 13:02:16 +05:00
2021-04-01 21:58:29 -04:00