diff --git a/django/contrib/admin/media/js/SelectFilter2.js b/django/contrib/admin/media/js/SelectFilter2.js index db946a6f6f..5a0344702c 100644 --- a/django/contrib/admin/media/js/SelectFilter2.js +++ b/django/contrib/admin/media/js/SelectFilter2.js @@ -16,6 +16,10 @@ function findForm(node) { var SelectFilter = { init: function(field_id, field_name, is_stacked, admin_media_prefix) { + if (field_id.match(/__prefix__/)){ + // Don't intialize on empty forms. + return; + } var from_box = document.getElementById(field_id); from_box.id += '_from'; // change its ID from_box.className = 'filtered'; diff --git a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js index 016de90f28..fbaa599c7a 100644 --- a/django/contrib/admin/media/js/admin/DateTimeShortcuts.js +++ b/django/contrib/admin/media/js/admin/DateTimeShortcuts.js @@ -11,6 +11,7 @@ var DateTimeShortcuts = { calendarLinkName: 'calendarlink',// name of the link that is used to toggle clockDivName: 'clockbox', // name of clock