silverfix/django-nested-inlines — pull request #13 by sandinmyjoints (2014-06-18 21:15:59+00:00)
Title: Add inlines.min.js.

In normal Django (without django-nested-inlines), a script tag to load js is inserted into the admin template when inlines are used. It is loaded through django/contrib/admin/options.py. If you are not in debug mode, instead of inlines.js, it will load inlines.min.js.

If you use django-nested-inlines, then Django will see the Media class in nested_inlines/admin.py that says to use inlines.js, so it will insert a script tag to load inlines.js into the admin template. But it will come *before* the script tag for Django’s own inlines.

In debug mode, everything appears fine. There are two script tags that both load inlines.js, and they both load django-nested-inlines inlines.js.

When I ran my app not in debug mode, then there were two script tags like this:

```html

```

Django collectstatic found django-nested-inlines version of inlines.js and it also found Django's own inlines.min.js, and because I was running not in debug mode, options.py inserted a script tag for inlines.min.js which is the normal Django file. Because it came after django-nested-inlines inlines.js, it overrode the functions defined in that file which broke nested inllnes.

A quick fix is to include inlines.min.js in django-nested-inlines.