From 7b6f0ec6cb7701701a593efc91e7d011dc1f0537 Mon Sep 17 00:00:00 2001 From: Sahil-tarento <140611066+Sahil-tarento@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:07:51 +0530 Subject: [PATCH] Remove Live check for userList (#423) --- .../cbp/service/CbPlanServiceImpl.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/sunbird/cbp/service/CbPlanServiceImpl.java b/src/main/java/org/sunbird/cbp/service/CbPlanServiceImpl.java index 43052fd3c..89a752a1a 100644 --- a/src/main/java/org/sunbird/cbp/service/CbPlanServiceImpl.java +++ b/src/main/java/org/sunbird/cbp/service/CbPlanServiceImpl.java @@ -498,24 +498,24 @@ public SBApiResponse getCBPlanListForUser(String userOrgId, String authTokenOrUs if (!courseDetailsMap.containsKey(courseId)) { contentDetails = contentService.readContentFromCache(courseId, null); if (MapUtils.isNotEmpty(contentDetails)) { - if (Constants.LIVE.equalsIgnoreCase((String) contentDetails.get(Constants.STATUS))) { - if (courseId.contains("_rc")) { - if (isVerifiedKaramyogi != null && isVerifiedKaramyogi) { - Map secureSettings = (Map) contentDetails.get(Constants.SECURE_SETTINGS); - if (MapUtils.isNotEmpty(secureSettings)) { - List secureOrganisationList = (List) secureSettings.get(Constants.ORGANISATION); - if (CollectionUtils.isNotEmpty(secureOrganisationList) && secureOrganisationList.contains(userOrgId)) { - courseDetailsMap.put(courseId, contentDetails); - } + //if (Constants.LIVE.equalsIgnoreCase((String) contentDetails.get(Constants.STATUS))) { + if (courseId.contains("_rc")) { + if (isVerifiedKaramyogi != null && isVerifiedKaramyogi) { + Map secureSettings = (Map) contentDetails.get(Constants.SECURE_SETTINGS); + if (MapUtils.isNotEmpty(secureSettings)) { + List secureOrganisationList = (List) secureSettings.get(Constants.ORGANISATION); + if (CollectionUtils.isNotEmpty(secureOrganisationList) && secureOrganisationList.contains(userOrgId)) { + courseDetailsMap.put(courseId, contentDetails); } } - if (!courseDetailsMap.containsKey(courseId)) { - contentDetails.clear(); - } - } else { - courseDetailsMap.put(courseId, contentDetails); } + if (!courseDetailsMap.containsKey(courseId)) { + contentDetails.clear(); + } + } else { + courseDetailsMap.put(courseId, contentDetails); } + //} } else { logger.error("Failed to read course details for Id: " + courseId); } @@ -1074,7 +1074,7 @@ private boolean validateRequestCbplanPayload(String userId, Map private boolean updateLookupInfoForProperties(List> cbPlanMap, CbPlan planDto) { boolean isUpdatedLookup = true; for (Map cbLookupInfo : cbPlanMap) { - Date endDate = (Date)cbLookupInfo.get(Constants.END_DATE); + Date endDate = (Date) cbLookupInfo.get(Constants.END_DATE); if (!planDto.getEndDate().equals(endDate)) { Map compositeKey = new HashMap<>(); compositeKey.put(Constants.ORG_ID, planDto.getOrgId());