summaryrefslogtreecommitdiffstats
path: root/install/ui/association.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2011-09-27 10:00:27 +0200
committerEndi S. Dewata <edewata@redhat.com>2011-09-27 14:44:00 +0000
commit2028a4095d00054fb2015ab38d1f3720ea105e13 (patch)
tree7e6676a6ee19ebb9f0072cf2a3fa775bd45ffedf /install/ui/association.js
parenta2a42c3be8e7a0fb591af14b3da298b5ae35b6ac (diff)
downloadfreeipa-2028a4095d00054fb2015ab38d1f3720ea105e13.tar.gz
freeipa-2028a4095d00054fb2015ab38d1f3720ea105e13.tar.xz
freeipa-2028a4095d00054fb2015ab38d1f3720ea105e13.zip
Fixed: Enrolment dialog offers to add entity to reflexive association.
https://fedorahosted.org/freeipa/ticket/1883 It's a regression introduced by patch for #1797 Reproduce: * show user group foo * click on user groups tab * click on enroll button Result: User group 'foo' is listed in available list. Expected result: User group 'foo' is not listed in available list.
Diffstat (limited to 'install/ui/association.js')
-rw-r--r--install/ui/association.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/install/ui/association.js b/install/ui/association.js
index 47d8db173..f2ef11dac 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -180,10 +180,12 @@ IPA.association_adder_dialog = function(spec) {
var selected = that.get_selected_values();
var results = data.result;
+ var same_entity = that.entity.name === other_entity.name;
for (var i=0; i<results.count; i++) {
var result = results.result[i];
var pkey = result[pkey_attr][0];
+ if (same_entity && pkey === that.pkey) continue;
if (that.exclude.indexOf(pkey) >= 0) continue;
if (selected.indexOf(pkey) >= 0) continue;