We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e16424 commit c082f0eCopy full SHA for c082f0e
1 file changed
openwisp_controller/config/static/config/js/relevant_templates.js
@@ -73,7 +73,14 @@ django.jQuery(function ($) {
73
var value = templates.join(","),
74
templateField = templatesFieldName();
75
$(`input[name="${templateField}"]`).attr("value", value);
76
- if (pageLoading) {
+ if (
77
+ pageLoading ||
78
+ // Handle cases where the AJAX request finishes after initial page load.
79
+ // If we're editing an existing object and the initial value hasn't been set,
80
+ // assign it now to avoid false positives in the unsaved changes warning.
81
+ (!isAddingNewObject() &&
82
+ django._owcInitialValues[templateField] === undefined)
83
+ ) {
84
django._owcInitialValues[templateField] = value;
85
}
86
$("input.sortedm2m:first").trigger("change");
0 commit comments