summaryrefslogtreecommitdiffstats
path: root/install/ui/association.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-09-26 13:44:22 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-09-27 14:43:48 +0000
commita2a42c3be8e7a0fb591af14b3da298b5ae35b6ac (patch)
treea3d2a77fdae34ca3d40a4d34e1036dd35b6cdcc5 /install/ui/association.js
parent8cf8870d3d11ace41cea1649d41f84341e0e94ac (diff)
downloadfreeipa-a2a42c3be8e7a0fb591af14b3da298b5ae35b6ac.tar.gz
freeipa-a2a42c3be8e7a0fb591af14b3da298b5ae35b6ac.tar.xz
freeipa-a2a42c3be8e7a0fb591af14b3da298b5ae35b6ac.zip
Fixed duplicate entries in enrollment dialog.
The IPA.association_adder_dialog has been modified not to show search results that are already selected to prevent duplicates. Ticket #1859
Diffstat (limited to 'install/ui/association.js')
-rw-r--r--install/ui/association.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/install/ui/association.js b/install/ui/association.js
index 3d75072ae..47d8db173 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -177,14 +177,17 @@ IPA.association_adder_dialog = function(spec) {
var other_entity = IPA.get_entity(that.other_entity);
var pkey_attr = other_entity.metadata.primary_key;
+ var selected = that.get_selected_values();
+
var results = data.result;
for (var i=0; i<results.count; i++) {
var result = results.result[i];
var pkey = result[pkey_attr][0];
- if (that.exclude.indexOf(pkey) < 0) {
- that.add_available_value(result);
- }
+ if (that.exclude.indexOf(pkey) >= 0) continue;
+ if (selected.indexOf(pkey) >= 0) continue;
+
+ that.add_available_value(result);
}
}