fix: empty mail on import
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 10m30s

This commit is contained in:
Thibaut Valentin 2025-11-14 13:43:51 +01:00
parent b143cc759f
commit d02fd63834

View File

@ -236,17 +236,17 @@ public class MembreService {
return mm;
});
if (model.getEmail() != null) {
if (model.getEmail() != null && !model.getEmail().isBlank()) {
if (model.getLicence() != null && !model.getLicence().equals(dataIn.getLicence())) {
LOGGER.info("Similar membres found: " + model);
throw new DBadRequestException("Email déja utiliser");
throw new DBadRequestException("Email '" + model.getEmail() + "' déja utiliser");
}
if (StringSimilarity.similarity(model.getLname().toUpperCase(),
dataIn.getNom().toUpperCase()) > 3 || StringSimilarity.similarity(
model.getFname().toUpperCase(), dataIn.getPrenom().toUpperCase()) > 3) {
LOGGER.info("Similar membres found: " + model);
throw new DBadRequestException("Email déja utiliser");
throw new DBadRequestException("Email '" + model.getEmail() + "' déja utiliser");
}
}