Ticket #700

Pavel
>From 793314369f6587fa1819a17bb0b196e09939c3f3 Mon Sep 17 00:00:00 2001
From: Pavel Zuna <pz...@redhat.com>
Date: Wed, 5 Jan 2011 09:31:02 -0500
Subject: [PATCH] Make it impossible to add an object as a member of itself in webUI.

Ticket #700
---
 install/static/associate.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/install/static/associate.js b/install/static/associate.js
index 6517cca..60e7c09 100644
--- a/install/static/associate.js
+++ b/install/static/associate.js
@@ -164,9 +164,12 @@ function ipa_association_adder_dialog(spec) {
             var results = data.result;
             that.clear_available_values();
 
+            var pkey_attr = IPA.metadata[that.entity_name].primary_key;
+
             for (var i=0; i<results.count; i++){
                 var result = results.result[i];
-                that.add_available_value(result);
+                if (result[pkey_attr] != spec.pkey)
+                    that.add_available_value(result);
             }
         }
 
-- 
1.7.1.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to