Skip to content

Commit 3d76aaa

Browse files
committed
KB-11577 :: BE | DEV | Adding the logic for updating the SpecialEventCertificate Implementation.
1 parent 4c9a4e3 commit 3d76aaa

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

all-actors/src/main/java/org/sunbird/cert/actor/CertBackgroundActor.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ private void addToRegistryAndUpdateCassandraRecord(Request request) {
9393
certificateMap.put(JsonKeys.TOKEN, accessCode);
9494
certificateMap.put(JsonKeys.NAME, certificateTemplate.get(JsonKeys.NAME));
9595
certificateMap.put(JsonKeys.VERSION, JsonKeys.VERSION_2);
96-
String specialEventCertificateName = propertiesCache.getProperty(JsonKeys.SPECIAL_CERTIFICATE_TEMPLATE_MAP);
97-
if (StringUtils.isNotBlank(specialEventCertificateName)) {
98-
logger.info("The Special Event Certificate is present and value is::: " + specialEventCertificateName);
99-
certificateMap.put(JsonKeys.EVENT_ISSUE_NAME, specialEventCertificateName);
100-
}
10196
issuedCertificateList.add(certificateMap);
10297
updateUserEnrolmentRecord(userId, courseId, batchId, issuedCertificateList, isEvent);
10398
} else {

all-actors/src/main/java/org/sunbird/cert/actor/CertificateGeneratorActor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ public class CertificateGeneratorActor extends BaseActor {
7979

8080
static {
8181
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
82+
log.info("CertificateGeneratorActor initialized.");
8283
try {
8384
String json = Platform.getString(JsonKeys.SPECIAL_CERTIFICATE_TEMPLATE_MAP, "");
84-
if (json == null || json.isEmpty()) {
85+
if (StringUtils.isBlank(json)) {
8586
specialEventCertificateTemplateMap = Collections.emptyMap();
8687
} else {
8788
specialEventCertificateTemplateMap = mapper.readValue(
@@ -249,7 +250,7 @@ private String generatePrintURIAndUpdateRecord(String courseId, String batchId,
249250
} else {
250251
String certificateAccessCodeV1 = issuedCertificateList.stream()
251252
.filter(cert -> !cert.containsKey(JsonKeys.VERSION)) // keep only those with the key
252-
.map(cert -> (String) cert.get(JsonKeys.ACCESS_CODE))
253+
.map(cert -> (String) cert.get(JsonKeys.TOKEN))
253254
.filter(Objects::nonNull)
254255
.findFirst()
255256
.orElse(null);

0 commit comments

Comments
 (0)