Skip to content

Commit

Permalink
replace verification date cutoff with new flag
Browse files Browse the repository at this point in the history
  • Loading branch information
auumgn committed Dec 17, 2024
1 parent 645cf88 commit 5e57abc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;

import static org.orcid.core.constants.EmailConstants.VERIFICATION_DATE_CUTOFF;

public class SummaryManagerImpl implements SummaryManager {
@Resource(name = "recordNameManagerReadOnlyV3")
Expand Down Expand Up @@ -284,7 +283,7 @@ public RecordSummaryPojo getRecordSummaryPojo(String orcid) {
for (EmailDomain ed : recordSummary.getEmailDomains().getEmailDomains()) {
EmailDomainSummary eds = new EmailDomainSummary();
eds.setValue(ed.getValue());
if (ed.getVerificationDate() != null && ed.getVerificationDate().after(VERIFICATION_DATE_CUTOFF)) {
if (ed.getVerificationDate() != null) {
eds.setVerificationDate(ed.getVerificationDate().toString());
}
emailDomains.add(eds);
Expand Down Expand Up @@ -525,8 +524,8 @@ public void generateEmailDomainsSummary(RecordSummary recordSummary, String orci
for (ProfileEmailDomainEntity ped : emailDomains) {
ed = new EmailDomain();
ed.setValue(ped.getEmailDomain());
VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated()));
if (verificationDate.after(VERIFICATION_DATE_CUTOFF)) {
if (!ped.getGeneratedByScript()) {
VerificationDate verificationDate = new VerificationDate(DateUtils.convertToXMLGregorianCalendar(ped.getDateCreated()));
ed.setVerificationDate(verificationDate);
}
edList.add(ed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public class EmailConstants {

public static final String DO_NOT_REPLY_VERIFY_ORCID_ORG = "ORCID - Do not reply <[email protected]>";

public static final VerificationDate VERIFICATION_DATE_CUTOFF;

static {
XMLGregorianCalendar gregorianCutoffDate = null;
VerificationDate verificationDate = null;
Expand All @@ -46,6 +44,5 @@ public class EmailConstants {
throw new RuntimeException("Error initializing XMLGregorianCalendar", e);
}

VERIFICATION_DATE_CUTOFF = verificationDate;
}
}

0 comments on commit 5e57abc

Please sign in to comment.