Skip to content

Commit

Permalink
fix: Affiliation type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielPalafox committed Jan 15, 2024
1 parent 69f1eaf commit b5f7108
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b5f7108

Please sign in to comment.