def find_deliberation_date(nb_session, offer_year):
    """"
    :param nb_session The number of session research
    :param offer_year The offer year research
    :return the deliberation date of the offer and session
    """
    session_exam_cals = SessionExamCalendar.objects.filter(number_session=nb_session,
                                                           academic_calendar__reference=academic_calendar_type.DELIBERATION)
    academic_cals_id = [session_exam.academic_calendar_id for session_exam in list(session_exam_cals)]

    if academic_cals_id:
        offer_year_cal = offer_year_calendar.find_by_offer_year(offer_yr=offer_year)\
                       .filter(academic_calendar__in=academic_cals_id)\
                       .first()
        return offer_year_cal.start_date if offer_year_cal.start_date else \
                                            offer_year_cal.academic_calendar.start_date

    return None
Example #2
0
def find_deliberation_date(nb_session, offer_year):
    """"
    :param nb_session The number of session research
    :param offer_year The offer year research
    :return the deliberation date of the offer and session
    """
    session_exam_cals = SessionExamCalendar.objects.filter(
        number_session=nb_session,
        academic_calendar__reference=academic_calendar_type.DELIBERATION
    )
    academic_cals_id = [session_exam.academic_calendar_id for session_exam in list(session_exam_cals)]

    if academic_cals_id:
        offer_year_cal = offer_year_calendar.find_by_offer_year(offer_yr=offer_year) \
            .filter(academic_calendar__in=academic_cals_id) \
            .first()
        return offer_year_cal.start_date

    return None