Corregido error al validar NIFs duplicados.
Formateo del NIF introducido.
This commit is contained in:
@@ -213,12 +213,15 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
||||
*/
|
||||
public void handleNIFValueChange() {
|
||||
boolean isDupe = false;
|
||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
||||
|
||||
if (ValidationUtils.checkIfNifAlreadyRegistered(this.getRemoteManagerCommon(), this.userType, this.nif, this.id) == true) {
|
||||
isDupe = true;
|
||||
this.addFacesMessage("frmUpdateProfile:nif", FacesMessage.SEVERITY_WARN, "NIF duplicado", "El nif indicado pertenece a otro usuario previamente registrado");
|
||||
}
|
||||
|
||||
PrimeFaces.current().ajax().addCallbackParam("NIFisDupe", isDupe);
|
||||
PrimeFaces.current().ajax().addCallbackParam("formattedNIF", this.nif);
|
||||
}
|
||||
|
||||
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
||||
@@ -318,6 +321,8 @@ public class UpdateProfileMBean extends ManagedBeanBase implements Serializable
|
||||
// Si no hay tipo de usuario, es que algo raro ha pasado (sesión caducada?). salimos.
|
||||
if (this.userType == null)
|
||||
return;
|
||||
|
||||
this.nif = ValidationUtils.normalizeNIF(this.nif);
|
||||
|
||||
boolean changePassword = (this.oldPassword != null && this.oldPassword.equals("") == false) || (this.password != null && this.password.equals("") == false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user