@task(default_retry_delay=settings.CREDIT_TASK_DEFAULT_RETRY_DELAY, max_retries=settings.CREDIT_TASK_MAX_RETRIES)
def update_credit_course_requirements(course_id):
 try:
  course_key = CourseKey.from_string(course_id)
  is_credit_course = CreditCourse.is_credit_course(course_key)
  if is_credit_course:
   requirements = _get_course_credit_requirements(course_key)
   set_credit_requirements(course_key, requirements)
 except (InvalidKeyError, ItemNotFoundError, InvalidCreditRequirements) as exc:
  LOGGER.error('Error on adding the requirements for course %s - %s', course_id, unicode(exc))
  raise update_credit_course_requirements.retry(args=[course_id], exc=exc)
 else:
  LOGGER.info('Requirements added for course %s', course_id)

@ task ( default_retry_delay = settings . CREDIT_TASK_DEFAULT_RETRY_DELAY , max_retries = settings . CREDIT_TASK_MAX_RETRIES ) def update_credit_course_requirements ( course_id ) : try : course_key = CourseKey . from_string ( course_id ) is_credit_course = CreditCourse . is_credit_course ( course_key ) if is_credit_course : requirements = _get_course_credit_requirements ( course_key ) set_credit_requirements ( course_key , requirements ) except ( InvalidKeyError , ItemNotFoundError , InvalidCreditRequirements ) as exc : LOGGER . error ( 'Error on adding the requirements for course %s - %s' , course_id , unicode ( exc ) ) raise update_credit_course_requirements . retry ( args = [ course_id ] , exc = exc ) else : LOGGER . info ( 'Requirements added for course %s' , course_id )
updates course requirements table for a course .