Skip to content

Commit

Permalink
Fixes #38264 - prevent duplicate entries
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Mar 4, 2025
1 parent 206baa0 commit ed58efc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ var KT = KT ? KT : {};
KT.hosts = {};

$(document).on('ContentLoad', function(){
if (!window.bodyLoadInitialized) {
window.bodyLoadInitialized = true;

KT.hosts.onKatelloHostEditLoad();
window.tfm.hosts.registerPluginAttributes("os",
['lifecycle_environment_id', 'content_view_id', 'environment_id', 'content_source_id', 'architecture_id', 'parent_id']);
Expand All @@ -11,6 +14,7 @@ $(document).on('ContentLoad', function(){

KT.hosts.update_media_enablement();
KT.hosts.set_media_selection_bindings();
}
});

KT.hosts.contentSourceChanged = function() {
Expand Down Expand Up @@ -43,7 +47,7 @@ KT.hosts.fetchEnvironments = function () {
orgIds = orgIds.map(id => Number(id));
$.get(url, function (content_source) {
$.each(content_source.lifecycle_environments, function(index, env) {
// Don't show environments that aren't in the selected org. See jQuery.each() docs
// Don't show environments that aren't in the selected org. See jQuery.each() docs
if (!orgIds.includes(env.organization_id)) return true;
option = $("<option />").val(env.id).text(env.name);
select.append(option);
Expand Down

0 comments on commit ed58efc

Please sign in to comment.