Closed mardukbp closed 3 months ago
@mardukbp can you check how Django handles this for the autocomplete field in admin integration? Otherwise, please don't hesitate to provide a patch. Cheers! Joe
I learned how to fix this in the source code of AutocompleteMixin :)
Patch submitted :)
🤙 nice 🤙
Bug Description
When using django-select2 in the Django Admin (regardless of the value of settings.LANGUAGE_CODE) the corresponding i18n file (e.g. en.js) throws the following exception in the brower console:
The problem is that jquery.init.js is loaded before this file. In order to load it afterwards this line has to be replaced with:
Steps to Reproduce
Visit the admin page for the model (admin/app/person/add/)
Open the browser console and find the exception thrown in en.js
Expected Behavior
No exception is thrown and the i18n works as expected