diff --git a/django/contrib/admin/static/admin/js/prepopulate.js b/django/contrib/admin/static/admin/js/prepopulate.js
index 24f24f9..27a1498 100644
a
|
b
|
|
14 | 14 | field.change(function() { |
15 | 15 | field.data('_changed', true); |
16 | 16 | }); |
| 17 | if (field.val()) { |
| 18 | field.data('_filled', true); |
| 19 | } else { |
| 20 | field.data('_filled', false); |
| 21 | } |
17 | 22 | |
18 | 23 | var populate = function () { |
19 | 24 | // Bail if the fields value has changed |
20 | | if (field.data('_changed') == true) return; |
| 25 | if (field.data('_changed') == true || field.data('_filled') == true) return; |
21 | 26 | |
22 | 27 | var values = []; |
23 | 28 | $.each(dependencies, function(i, field) { |
diff --git a/django/contrib/admin/templatetags/admin_modify.py b/django/contrib/admin/templatetags/admin_modify.py
index f6ac596..65ca7af 100644
a
|
b
|
def prepopulated_fields_js(context):
|
9 | 9 | the prepopulated fields for both the admin form and inlines. |
10 | 10 | """ |
11 | 11 | prepopulated_fields = [] |
12 | | if context['add'] and 'adminform' in context: |
| 12 | if 'adminform' in context: |
13 | 13 | prepopulated_fields.extend(context['adminform'].prepopulated_fields) |
14 | 14 | if 'inline_admin_formsets' in context: |
15 | 15 | for inline_admin_formset in context['inline_admin_formsets']: |