Esempio n. 1
0
def add_and_update_low_recruit_attendances():
    """

    :param month_dt:
    :return:
    """
    low_attendance_warning_type = MemberWarningType.objects.get(
        name__iexact="Low Attendance (Recruit)")

    members = Member.recruits()

    for member in members:
        start_dt = member.join_date
        end_dt, event_count = member.get_recruit_event_attendance_deadline_and_count(
        )

        events = Event.all_for_time_period(start_dt, end_dt)
        adequate, message = Attendance.was_adequate_for_period(
            member,
            events,
            start_dt,
            end_dt,
            adequate_if_absent=False,
            min_total_events=event_count)

        create_or_update_warning(member, low_attendance_warning_type,
                                 not adequate, message)
Esempio n. 2
0
def add_and_update_mod_assessment_due():
    """

    :return:
    """
    mod_assessment_due_warning_type = MemberWarningType.objects.get(name__iexact="Mod Assessment Due")
    recruits = Member.recruits()

    for member in recruits:
        mod_assessment_due, message = member.is_mod_assessment_due()
        create_or_update_warning(member, mod_assessment_due_warning_type, mod_assessment_due, message)
Esempio n. 3
0
def add_and_update_grunt_qualification_due():
    """

    :return:
    """
    grunt_qualification_due_warning_type = MemberWarningType.objects.get(name__iexact="Grunt Qualification Due")
    recruits = Member.recruits()

    for member in recruits:
        grunt_qualification_due, message = member.is_grunt_qualification_due()
        create_or_update_warning(member, grunt_qualification_due_warning_type, grunt_qualification_due, message)
Esempio n. 4
0
def add_and_update_mod_assessment_due():
    """

    :return:
    """
    mod_assessment_due_warning_type = MemberWarningType.objects.get(
        name__iexact="Mod Assessment Due")
    recruits = Member.recruits()

    for member in recruits:
        mod_assessment_due, message = member.is_mod_assessment_due()
        create_or_update_warning(member, mod_assessment_due_warning_type,
                                 mod_assessment_due, message)
Esempio n. 5
0
def add_and_update_grunt_qualification_due():
    """

    :return:
    """
    grunt_qualification_due_warning_type = MemberWarningType.objects.get(
        name__iexact="Grunt Qualification Due")
    recruits = Member.recruits()

    for member in recruits:
        grunt_qualification_due, message = member.is_grunt_qualification_due()
        create_or_update_warning(member, grunt_qualification_due_warning_type,
                                 grunt_qualification_due, message)
Esempio n. 6
0
def add_and_update_low_recruit_attendances():
    """

    :param month_dt:
    :return:
    """
    low_attendance_warning_type = MemberWarningType.objects.get(name__iexact="Low Attendance (Recruit)")

    members = Member.recruits()

    for member in members:
        start_dt = member.join_date
        end_dt, event_count = member.get_recruit_event_attendance_deadline_and_count()

        events = Event.all_for_time_period(start_dt, end_dt)
        adequate, message = Attendance.was_adequate_for_period(member, events, start_dt, end_dt,
                                                               adequate_if_absent=False,
                                                               min_total_events=event_count)

        create_or_update_warning(member, low_attendance_warning_type, not adequate, message)