Files
edx-platform/lms/djangoapps/notes/utils.py
Stu Young 1e01baf979 INCR-255 Run python-modernize on lms/djangoapps/notes (#20565)
* run python modernize

* run isort

* Fix quality
2019-05-21 11:38:26 -04:00

23 lines
540 B
Python

"""
Notes utilities
"""
from __future__ import absolute_import
from django.conf import settings
def notes_enabled_for_course(course):
'''
Returns True if the notes app is enabled for the course, False otherwise.
In order for the app to be enabled it must be:
1) enabled globally via FEATURES.
2) present in the course tab configuration.
'''
tab_found = "notes" in course.advanced_modules
feature_enabled = settings.FEATURES.get('ENABLE_STUDENT_NOTES')
return feature_enabled and tab_found