You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2019/04/03 19:52:04 UTC

[airavata] branch develop updated: AIRAVATA-3002 Only add user to registry if doesn't exist

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 1690e3f  AIRAVATA-3002 Only add user to registry if doesn't exist
1690e3f is described below

commit 1690e3f55e590639354f4824e8201e30068cb617
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Apr 3 15:47:50 2019 -0400

    AIRAVATA-3002 Only add user to registry if doesn't exist
---
 .../registry/api/service/messaging/RegistryServiceDBEventHandler.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
index a099e8f..362db44 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/messaging/RegistryServiceDBEventHandler.java
@@ -138,7 +138,9 @@ public class RegistryServiceDBEventHandler implements MessageHandler {
                         switch (publisherContext.getCrudType()) {
                             case CREATE: {
                                 logger.info("Replicating addUser in Registry.");
-                                registryClient.addUser(userProfile);
+                                if (!registryClient.isUserExists(userProfile.getGatewayId(), userProfile.getUserId())) {
+                                    registryClient.addUser(userProfile);
+                                }
                                 Project defaultProject = createDefaultProject(registryClient, userProfile);
                                 if (defaultProject != null) {