From b5f7108811cdb99d591c3c02e7f157ef1bbfb062 Mon Sep 17 00:00:00 2001 From: Daniel Palafox Date: Mon, 15 Jan 2024 13:15:23 -0500 Subject: [PATCH] fix: Affiliation type validation --- .../frontend/web/controllers/RegistrationController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java index 1314fe3345b..b06c4b7574a 100644 --- a/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java +++ b/orcid-web/src/main/java/org/orcid/frontend/web/controllers/RegistrationController.java @@ -48,7 +48,7 @@ import org.orcid.jaxb.model.common.AvailableLocales; import org.orcid.jaxb.model.message.CreationMethod; import org.orcid.jaxb.model.v3.release.common.Visibility; -import org.orcid.jaxb.model.v3.release.search.Search; +import org.orcid.jaxb.model.v3.release.record.AffiliationType; import org.orcid.persistence.constants.SendEmailFrequency; import org.orcid.pojo.Redirect; import org.orcid.pojo.ajaxForm.AffiliationForm; @@ -331,7 +331,7 @@ public void validateRegistrationFields(HttpServletRequest request, Registration if (Features.REGISTRATION_2_0.isActive() && reg.getAffiliationForm() != null) { AffiliationForm affiliationForm = reg.getAffiliationForm(); - if (!affiliationForm.getAffiliationType().getValue().equals("Employment")) { + if (!AffiliationType.EMPLOYMENT.equals(AffiliationType.fromValue(affiliationForm.getAffiliationType().getValue()))) { setError(affiliationForm.getAffiliationType(), "Invalid affiliation type"); } if (reg.getAffiliationForm().getDepartmentName() != null) {