Skip to content

Commit

Permalink
Merge pull request #3 from boilerroomtv/slug_prepopulate_django_bugfix
Browse files Browse the repository at this point in the history
fix: noticket - Adds prepopulate bugfix from django 4.1 to 3.2
  • Loading branch information
Winspear authored Oct 10, 2022
2 parents accdd05 + 2ab8b58 commit c8c5b01
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions django/contrib/admin/static/admin/js/inlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@
dependencies = [];
$.each(dependency_list, function(i, field_name) {
dependencies.push('#' + row.find('.form-row .field-' + field_name).find('input, select, textarea').attr('id'));
// Dependency in a fieldset.
let field_element = row.find('.form-row .field-' + field_name);
// Dependency without a fieldset.
if (!field_element.length) {
field_element = row.find('.form-row.field-' + field_name);
}
dependencies.push('#' + field_element.find('input, select, textarea').attr('id'));
});
if (dependencies.length) {
input.prepopulate(dependencies, input.attr('maxlength'));
Expand Down

0 comments on commit c8c5b01

Please sign in to comment.