Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ms-mw

Issue #1 feat:merge
  • Loading branch information
AMIT KUMAR committed Nov 6, 2017
2 parents 3c27875 + 7fbfd65 commit ca40081
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import static org.sunbird.learner.util.Util.isNotNull;
import static org.sunbird.learner.util.Util.isNull;

import akka.actor.UntypedAbstractActor;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.velocity.VelocityContext;
import org.sunbird.cassandra.CassandraOperation;
import org.sunbird.common.Constants;
Expand Down Expand Up @@ -41,6 +41,8 @@
import org.sunbird.services.sso.SSOManager;
import org.sunbird.services.sso.SSOServiceFactory;

import akka.actor.UntypedAbstractActor;

/**
* This actor will handle course enrollment operation .
*
Expand Down Expand Up @@ -188,7 +190,6 @@ private void profileVisibility(Request actorMessage) {
if (esPrivateResult.containsKey(field)) {
esResult.put(field,esPrivateResult.get(field) );
esPrivateResult.remove(field);
privateList.remove(field);
} else {
ProjectLogger.log("field value not found inside private index =="+field);
}
Expand All @@ -200,6 +201,14 @@ private void profileVisibility(Request actorMessage) {
privateFieldMap.put(key, JsonKey.PRIVATE);
}
}
if (publicList != null && privateFieldMap.isEmpty()) {
privateFieldMap = (Map<String, String>) esResult.get(JsonKey.PROFILE_VISIBILITY);
for (String key : publicList) {
privateFieldMap.remove(key);
}
updateCassandraWithPrivateFiled(userId, privateFieldMap);
esResult.put(JsonKey.PROFILE_VISIBILITY, privateFieldMap);
}
if (privateFieldMap.size()>0) {
updateCassandraWithPrivateFiled(userId, privateFieldMap);
esResult.put(JsonKey.PROFILE_VISIBILITY, privateFieldMap);
Expand Down

0 comments on commit ca40081

Please sign in to comment.