Skip to content

Commit

Permalink
Fixed issues in validating Designation
Browse files Browse the repository at this point in the history
  • Loading branch information
karthik-tarento committed Jun 20, 2024
1 parent ae9cb1c commit 2707734
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/sunbird/common/util/ProjectUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public static Boolean validateEmployeeId(String employeeId) {
}

public static Boolean validateRegexPatternWithNoSpecialCharacter(String regex) {
return regex.matches("^[a-zA-Z0-9 -()]*$");
return regex.matches("^[a-zA-Z0-9 \\-()]*$");
}

public static Boolean validatePinCode(String regex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ private List<String> validateReceivedKafkaMessage(HashMap<String, String> inputD
}

private boolean validateFieldValue(String fieldKey, String fieldValue) {
fieldValue = fieldValue.toLowerCase();
if(redisCacheMgr.keyExists(fieldKey)){
return !redisCacheMgr.valueExists(fieldKey, fieldValue);
} else{
Expand All @@ -488,7 +489,7 @@ private boolean validateFieldValue(String fieldKey, String fieldValue) {
if(!CollectionUtils.isEmpty(fieldValueList)) {
String columnName = fieldValueList.get(0).get("contextname") != null ? "contextname" : "contextName";
for(Map<String, Object> languageMap : fieldValueList){
designationsSet.add((String)languageMap.get(columnName));
designationsSet.add(((String)languageMap.get(columnName)).toLowerCase());
}
}
redisCacheMgr.putCacheAsStringArray(fieldKey, designationsSet.toArray(new String[0]), null);
Expand Down

0 comments on commit 2707734

Please sign in to comment.