diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index 2b1f5125b5..c8f051a559 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -574,12 +574,11 @@ class ModelAdmin(BaseModelAdmin): 'core.js', 'admin/RelatedObjectLookups.js', 'jquery%s.js' % extra, - 'jquery.init.js' + 'jquery.init.js', + 'actions%s.js' % extra, + 'urlify.js', + 'prepopulate%s.js' % extra, ] - if self.actions is not None: - js.append('actions%s.js' % extra) - if self.prepopulated_fields: - js.extend(['urlify.js', 'prepopulate%s.js' % extra]) return forms.Media(js=[static('admin/js/%s' % url) for url in js]) def get_model_perms(self, request): @@ -1751,8 +1750,6 @@ class InlineModelAdmin(BaseModelAdmin): def media(self): extra = '' if settings.DEBUG else '.min' js = ['jquery%s.js' % extra, 'jquery.init.js', 'inlines%s.js' % extra] - if self.prepopulated_fields: - js.extend(['urlify.js', 'prepopulate%s.js' % extra]) if self.filter_vertical or self.filter_horizontal: js.extend(['SelectBox.js', 'SelectFilter2.js']) return forms.Media(js=[static('admin/js/%s' % url) for url in js])