|
22 | 22 | import de.symeda.sormas.api.caze.CaseReferenceDto; |
23 | 23 | import de.symeda.sormas.api.contact.ContactReferenceDto; |
24 | 24 | import de.symeda.sormas.api.event.EventParticipantReferenceDto; |
| 25 | +import de.symeda.sormas.api.facility.FacilityDto; |
25 | 26 | import de.symeda.sormas.api.facility.FacilityHelper; |
26 | 27 | import de.symeda.sormas.api.i18n.Captions; |
27 | 28 | import de.symeda.sormas.api.i18n.I18nProperties; |
|
79 | 80 | import de.symeda.sormas.backend.util.JurisdictionHelper; |
80 | 81 | import de.symeda.sormas.backend.util.ModelConstants; |
81 | 82 | import de.symeda.sormas.backend.util.Pseudonymizer; |
| 83 | +import org.apache.commons.lang3.StringUtils; |
82 | 84 | import org.slf4j.Logger; |
83 | 85 | import org.slf4j.LoggerFactory; |
84 | 86 |
|
@@ -928,8 +930,10 @@ private void onSampleChanged(SampleDto existingSample, Sample newSample) { |
928 | 930 | caseFacade.onCaseChanged(CaseFacadeEjbLocal.toDto(newSample.getAssociatedCase()), newSample.getAssociatedCase()); |
929 | 931 | } |
930 | 932 |
|
931 | | - // Send an email to the lab user when a sample has been shipped to his lab |
932 | | - if (newSample.isShipped() && (existingSample == null || !existingSample.isShipped())) { |
| 933 | + // Send an email to the lab user when a sample has been shipped to their lab |
| 934 | + if (newSample.isShipped() |
| 935 | + && (existingSample == null || !existingSample.isShipped()) |
| 936 | + && !StringUtils.equals(newSample.getLab().getUuid(), FacilityDto.OTHER_FACILITY_UUID)) { |
933 | 937 | List<User> messageRecipients = userService.getLabUsersOfLab(newSample.getLab()); |
934 | 938 |
|
935 | 939 | for (User recipient : messageRecipients) { |
|
0 commit comments