'Returns whether the waffle flag was overridden (on or off) for the
course, or is unset.
Arguments:
waffle_flag (String): The name of the flag.
course_id (CourseKey): The course id for which the flag may have
been overridden.
If the current config is not set or disabled for this waffle flag and
course id, returns ALL_CHOICES.unset.
Otherwise, returns ALL_CHOICES.on or ALL_CHOICES.off as configured for
the override_choice.'

@classmethod
@request_cached
def override_value(cls, waffle_flag, course_id):

    if ((not course_id) or (not waffle_flag)):
        return cls.ALL_CHOICES.unset
    effective = cls.objects.filter(waffle_flag=waffle_flag, course_id=course_id).order_by('-change_date').first()
    if (effective and effective.enabled):
        return effective.override_choice
    return cls.ALL_CHOICES.unset
