'Add requirement to a given course.
Args:
credit_course(CreditCourse): The identifier for credit course
requirement(dict): Requirement dict to be added
Returns:
(CreditRequirement, created) tuple'

@classmethod
def add_or_update_course_requirement(cls, credit_course, requirement, order):

    (credit_requirement, created) = cls.objects.get_or_create(course=credit_course, namespace=requirement['namespace'], name=requirement['name'], defaults={'display_name': requirement['display_name'], 'criteria': requirement['criteria'], 'order': order, 'active': True})
    if (not created):
        credit_requirement.criteria = requirement['criteria']
        credit_requirement.active = True
        credit_requirement.order = order
        credit_requirement.display_name = requirement['display_name']
        credit_requirement.save()
    return (credit_requirement, created)
