Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects with custom AUTH_USER_MODEL are broken in version 3.2 #1495

Open
payamnj opened this issue Sep 13, 2024 · 3 comments
Open

Projects with custom AUTH_USER_MODEL are broken in version 3.2 #1495

payamnj opened this issue Sep 13, 2024 · 3 comments

Comments

@payamnj
Copy link
Contributor

payamnj commented Sep 13, 2024

For type hinting the user parameter in the filer/cache.py functions, a new change added to get the user model.

User = get_user_model()

Since this code can be executed before the django app is fully initialized (for example if we import FilerFileField in our application model)
it will not be able to load the custome auth user model.

django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'my_app.User' that has not been installed

Maybe we can just use TypeVar here for type hinting the user parameters instead!

@fsbraun
Copy link
Member

fsbraun commented Sep 13, 2024

@payamnj Thanks, for reporting this! Good catch.

@fsbraun
Copy link
Member

fsbraun commented Sep 13, 2024

@payamnj Can you create a PR?

@payamnj
Copy link
Contributor Author

payamnj commented Sep 13, 2024

@fsbraun Yes, I will create a PR for this.

payamnj added a commit to payamnj/django-filer that referenced this issue Sep 13, 2024
payamnj added a commit to payamnj/django-filer that referenced this issue Sep 13, 2024
payamnj added a commit to payamnj/django-filer that referenced this issue Sep 15, 2024
fsbraun pushed a commit that referenced this issue Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants