def check_if_enrolled(user, course):
    is_enrolled = False
    if (user.id is not None):
        num_results = Enrollment.objects.filter(user=user, course=course).count()
        if (num_results > 0):
            is_enrolled = True
    return is_enrolled
def check_if_enrolled(user, course):
    is_enrolled = False
    if (user.id is not None):
        num_results = Enrollment.objects.filter(user=user, course=course).count()
        if (num_results > 0):
            is_enrolled = True
    return is_enrolled