diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-09-26 13:44:22 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-09-27 14:43:48 +0000 |
commit | a2a42c3be8e7a0fb591af14b3da298b5ae35b6ac (patch) | |
tree | a3d2a77fdae34ca3d40a4d34e1036dd35b6cdcc5 /install/ui/association.js | |
parent | 8cf8870d3d11ace41cea1649d41f84341e0e94ac (diff) | |
download | freeipa-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.js | 9 |
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); } } |