-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
Unnecessary warning for missing django.middleware.locale.LocaleMiddleware if using customized middleware #354
Comments
@norbertschuler thank you for reporting this issue. |
@norbertschuler to avoid this warning when using a middleware subclass would require to import and check all middlewares everytime the template tag is called, now I'm wondering: wouldn't adding this check add too much overhead to avoid a simple warning which only purpose is to help users in case of setup mistakes? In the meantime, have you tried to ignore the warning? import warnings
warnings.filterwarnings("ignore", module="admin_interface.templatetags.admin_interface_tags") |
In fact we are now already doing this. |
@norbertschuler I added this to the FAQ section: I close this because it's not my intention to add this extra-check (as explained before). |
Python version
3.11.7
Django version
4.2.8
Package version
0.28.3
Current behavior (bug description)
If you do not use
django.middleware.locale.LocaleMiddleware
in yoursettings.MIDDLEWARE
but have an own custom middleware inheriting fromdjango.middleware.locale.LocaleMiddleware
the code atdjango-admin-interface/admin_interface/templatetags/admin_interface_tags.py
Line 28 in e895a05
Expected behavior
Omit the warning or think about another way to not throw an unnecessary warning?
Upvote & Fund
The text was updated successfully, but these errors were encountered: