Fix dependency on jquery for django 2.2+#127
Open
leibowitz wants to merge 2 commits intoOskarPersson:masterfrom
Open
Fix dependency on jquery for django 2.2+#127leibowitz wants to merge 2 commits intoOskarPersson:masterfrom
leibowitz wants to merge 2 commits intoOskarPersson:masterfrom
Conversation
Collaborator
|
Bumping because this issue is showing up in our error logs at work |
Contributor
|
Agreed, would be nice to include it in the next release |
Owner
|
How does this affect old versions of Django? |
Owner
|
@leibowitz I just tested this out in Django 1.8 and it results in another error that does not occur on master. Could you add something like this to this PR? @@ -49,10 +49,15 @@ class NestedModelAdmin(InlineInstancesMixin, admin.ModelAdmin):
css = {
"all": ('admin/css/forms-nested.css',)
}
- js = (
- 'admin/js/jquery.init.js',
- 'admin/js/inlines-nested%s.js' % ('' if settings.DEBUG else '.min'),
- )
+ if VERSION[:2] >= (2, 2):
+ js = (
+ 'admin/js/jquery.init.js',
+ 'admin/js/inlines-nested%s.js' % ('' if settings.DEBUG else '.min'),
+ )
+ else:
+ js = (
+ 'admin/js/inlines-nested%s.js' % ('' if settings.DEBUG else '.min'),
+ )
def save_formset(self, request, form, formset, change):
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://docs.djangoproject.com/en/3.2/releases/2.2/#merging-of-form-media-assets
jquery.init.js is already defined as a dependency on
NestedInline, but not onNestedModelAdmin, causing errors:https://github.com/s-block/django-nested-inline/blob/master/nested_inline/static/admin/js/inlines-nested.js#L18
Fix #106