From ed45b07a51eaf4a8685458ac798ef78d789e7c75 Mon Sep 17 00:00:00 2001 From: Gianni Moschini Date: Tue, 15 Jun 2021 15:21:31 +0100 Subject: [PATCH] Ignore fields with __prefix__ --- smart_selects/static/smart-selects/admin/js/bindfields.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smart_selects/static/smart-selects/admin/js/bindfields.js b/smart_selects/static/smart-selects/admin/js/bindfields.js index 295d563..1495bf3 100755 --- a/smart_selects/static/smart-selects/admin/js/bindfields.js +++ b/smart_selects/static/smart-selects/admin/js/bindfields.js @@ -7,6 +7,10 @@ id = "#" + $(item).attr("id"), value = JSON.parse($(item).attr("data-value")), auto_choose = $(item).attr("data-auto_choose"); + // Ignore fields that aren't displayed on-screen yet + if (id.indexOf('__prefix__') !== -1) { + return; + } if ($(item).hasClass("chained-fk")) { empty_label = $(item).attr("data-empty_label"); chainedfk.init(chainfield, url, id, value, empty_label, auto_choose);