Skip to content

Commit

Permalink
test for empty singup inquiry pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrenn committed Mar 9, 2024
1 parent 18a8035 commit dd16e2d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2057,13 +2057,19 @@ protected InquiriesPDFVO handleRenderInquiriesSignup(AuthenticationVO auth, Long
department = CheckIDUtil.checkDepartmentId(departmentId, this.getDepartmentDao());
}
Collection<Trial> trials = new ArrayList<Trial>();
Iterator<Trial> trialIt = this.getTrialDao().findBySignup(department != null ? department.getId() : null, true, null).iterator();
if (this.getTrialDao().findBySignup(departmentId, true, null).size() == 0) {
throw L10nUtil.initServiceException(ServiceExceptionCodes.MASS_MAIL_NO_PROBAND_LETTER_ATTACHMENT);
}
Iterator<Trial> trialIt = this.getTrialDao().findBySignup(departmentId, true, null).iterator();
while (trialIt.hasNext()) {
Trial trial = trialIt.next();
if (this.getInquiryValueDao().getCount(trial.getId(), null, activeSignup, proband.getId()) > 0) {
trials.add(trial);
}
}
if (trials.size() == 0) {
throw L10nUtil.initServiceException(ServiceExceptionCodes.PROBAND_LETTER_NOT_FOR_ANIMAL_ENTRIES);
}
InquiriesPDFVO result = ServiceUtil.renderInquiries(proband, probandVO,
trials,
null, activeSignup, false, this.getTrialDao(), this.getInquiryDao(), this.getInquiryValueDao(), this.getInputFieldDao(), this.getInputFieldSelectionSetValueDao(),
Expand Down

0 comments on commit dd16e2d

Please sign in to comment.