'Returns a validated list of course fields'

def _process_course_fields(self, fields):

    all_fields = CourseFields.__dict__.keys()
    non_course_fields = ['__doc__', '__module__', '__weakref__', '__dict__']
    for field in non_course_fields:
        all_fields.remove(field)
    date_fields = ['certificate_available_date', 'announcement', 'enrollment_start', 'enrollment_end', 'start', 'end']
    course_tab_list_fields = ['tabs']
    for field in dict(fields):
        if (field not in all_fields):
            del fields[field]
            logger.info((field + 'is    not    a    valid    CourseField'))
        elif (fields[field] is None):
            del fields[field]
        elif (field in date_fields):
            try:
                date_json = fields[field]
                fields[field] = Date().from_json(date_json)
                logger.info(((field + '    has    been    set    to    ') + date_json))
            except Exception:
                logger.info(('The    date    string    could    not    be    parsed    for    ' + field))
                del fields[field]
        elif (field in course_tab_list_fields):
            try:
                course_tab_list_json = fields[field]
                fields[field] = CourseTabList().from_json(course_tab_list_json)
                logger.info(((field + '    has    been    set    to    ') + course_tab_list_json))
            except Exception:
                logger.info(('The    course    tab    list    string    could    not    be    parsed    for    ' + field))
                del fields[field]
        else:
            logger.info(((field + '    has    been    set    to    ') + str(fields[field])))
    for field in all_fields:
        if (field not in fields):
            logger.info((field + '    has    not    been    set'))
    return fields
