diff --git a/avni-server-api/src/main/java/org/avni/server/web/UserController.java b/avni-server-api/src/main/java/org/avni/server/web/UserController.java index 79c4e9538..75e7075df 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/UserController.java +++ b/avni-server-api/src/main/java/org/avni/server/web/UserController.java @@ -54,8 +54,6 @@ public class UserController { @Value("${avni.userPhoneNumberPattern}") private String MOBILE_NUMBER_PATTERN; - - private final String NAME_PATTERN = "[a-zA-Z0-9 ]+"; private final AccessControlService accessControlService; @Autowired @@ -164,9 +162,6 @@ private Boolean phoneNumberIsValid(String phoneNumber) { return phoneNumber.matches(MOBILE_NUMBER_PATTERN); } - private boolean nameIsValid(String name) { - return name.matches(NAME_PATTERN); - } private User setUserAttributes(User user, UserContract userContract) { if (!emailIsValid(userContract.getEmail())) throw new ValidationException(String.format("Invalid email address %s", userContract.getEmail())); @@ -176,11 +171,7 @@ private User setUserAttributes(User user, UserContract userContract) { throw new ValidationException(String.format("Invalid phone number %s", userContract.getPhoneNumber())); user.setPhoneNumber(userContract.getPhoneNumber()); - - if (!nameIsValid(userContract.getPhoneNumber())) - throw new ValidationException(String.format("Invalid name %s", userContract.getName())); user.setName(userContract.getName()); - if(userContract.getCatchmentId()!=null) { user.setCatchment(catchmentRepository.findOne(userContract.getCatchmentId())); }