utils.py 476 Bytes
Newer Older
Arthur Barrett committed
1 2 3
from django.conf import settings


4
def notes_enabled_for_course(course):
Arthur Barrett committed
5

6
    '''
Arthur Barrett committed
7 8 9
    Returns True if the notes app is enabled for the course, False otherwise.

    In order for the app to be enabled it must be:
10
        1) enabled globally via FEATURES.
Arthur Barrett committed
11 12 13
        2) present in the course tab configuration.
    '''

14
    tab_found = "notes" in course.advanced_modules
15
    feature_enabled = settings.FEATURES.get('ENABLE_STUDENT_NOTES')
Arthur Barrett committed
16 17

    return feature_enabled and tab_found