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
Describe the bug
I have custom user model in module which imports simple_history.models (I think it is common to register historical records in models.py with custom user model.) It worked with simple-history 2.4.0.
But there is new call of get_user_model on class level (3726327). It raises exception:
File ".../models.py", line ..., in
import simple_history.models
File ".../simple_history/models.py", line 29, in
User = get_user_model()
File ".../django/contrib/auth/init.py", line 170, in get_user_model
"AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model '....User' that has not been installed
Class level User variable is used only once - so it is quite simple to call get_user_model in get_extra_fields method (one line down :)) - it solves problem.
To Reproduce
Define custom user model and import simple_history.models in models.py (for historization of users).
Set AUTH_USER_MODEL to this model.
Environment:
Django Simple History Version: 2.5.0
Django Version: 2.1.2
The text was updated successfully, but these errors were encountered:
Describe the bug
I have custom user model in module which imports simple_history.models (I think it is common to register historical records in models.py with custom user model.) It worked with simple-history 2.4.0.
But there is new call of get_user_model on class level (3726327). It raises exception:
File ".../models.py", line ..., in
import simple_history.models
File ".../simple_history/models.py", line 29, in
User = get_user_model()
File ".../django/contrib/auth/init.py", line 170, in get_user_model
"AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model '....User' that has not been installed
Class level User variable is used only once - so it is quite simple to call get_user_model in get_extra_fields method (one line down :)) - it solves problem.
To Reproduce
Environment:
The text was updated successfully, but these errors were encountered: