public static boolean isInValidCreditsPeriod(ExecutionSemester executionSemester, User user) {
   if (user == null) {
     return false;
   }
   if (RoleType.SCIENTIFIC_COUNCIL.isMember(user)) {
     return true;
   }
   TeacherCreditsFillingCE validCreditsPerid = getValidCreditsPeriod(executionSemester, user);
   return validCreditsPerid != null && validCreditsPerid.containsNow();
 }
 public static void checkValidCreditsPeriod(ExecutionSemester executionSemester, User user) {
   if (!RoleType.SCIENTIFIC_COUNCIL.isMember(user)) {
     TeacherCreditsFillingCE validCreditsPerid = getValidCreditsPeriod(executionSemester, user);
     if (validCreditsPerid == null) {
       throw new DomainException("message.invalid.credits.period2");
     } else if (!validCreditsPerid.containsNow()) {
       throw new DomainException(
           "message.invalid.credits.period",
           validCreditsPerid.getBegin().toString("dd-MM-yyy HH:mm"),
           validCreditsPerid.getEnd().toString("dd-MM-yyy HH:mm"));
     }
   }
 }
 public static boolean isInValidTeacherCreditsPeriod(ExecutionSemester executionSemester) {
   TeacherCreditsFillingCE validCreditsPerid =
       TeacherCreditsFillingForTeacherCE.getTeacherCreditsFillingForTeacher(
           executionSemester.getAcademicInterval());
   return validCreditsPerid != null && validCreditsPerid.containsNow();
 }