from datetime import timedelta
from django.utils import timezone
def should_update_grades(course_key):
some_waffle_switch = True // Some waffle switch which we can pull information from for active/inactive?
course = CourseOverview.get_from_id(course_key)
if some_waffle_switch and course.end: // Not sure if we are ok for self paced courses with ends dates to be the part of the change
grade_update_offset = course.end + timedelta(30) // There should some good place to store `30`. A config model/settings/static variable?
now = timezone.now()
if now > offset:
return False
return True
|