Skip to content

feat: enable Student Notes by default in InheritanceMixin#381

Open
alenkadev wants to merge 3 commits into
release-ulmofrom
alenka/turn-Notes-on-by-default
Open

feat: enable Student Notes by default in InheritanceMixin#381
alenkadev wants to merge 3 commits into
release-ulmofrom
alenka/turn-Notes-on-by-default

Conversation

@alenkadev

Copy link
Copy Markdown

Summary

Enable the Student Notes feature by default by changing the default value of the edxnotes setting in InheritanceMixin from False to True.

jira_link- https://2u-internal.atlassian.net/browse/LP-952

Copilot AI review requested due to automatic review settings July 10, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables the Student Notes feature by default for courses by changing the InheritanceMixin.edxnotes field default from False to True, so courses that don’t explicitly set this advanced setting will now have Student Notes enabled when the global ENABLE_EDXNOTES feature flag is on.

Changes:

  • Changed InheritanceMixin.edxnotes default from False to True to enable Student Notes by default at the course setting level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 13, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread xmodule/tests/test_split_test_block.py Outdated
"""
def setUp(self):
super().setUp()
ApplicationFactory(name=settings.EDXNOTES_CLIENT_NAME)
Copilot AI review requested due to automatic review settings July 14, 2026 07:09
@alenkadev alenkadev force-pushed the alenka/turn-Notes-on-by-default branch from 881de37 to 8afcb00 Compare July 14, 2026 07:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines 65 to 66
@patch.dict('django.conf.settings.FEATURES', {'ENABLE_EDXNOTES': False})
class SplitTestBlockTest(XModuleXmlImportTest, PartitionTestCase):
@alenkadev alenkadev force-pushed the alenka/turn-Notes-on-by-default branch from 8afcb00 to e1d803b Compare July 14, 2026 07:48
Copilot AI review requested due to automatic review settings July 14, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +71 to +75
# Mock the OAuth2 client lookup for edxnotes to avoid infrastructure requirement in tests
oauth2_patcher = patch('openedx.core.djangoapps.oauth_dispatch.models.OAuth2Client.objects.get')
oauth2_patcher.return_value = Mock(client_id='edx-notes-test', redirect_uris='')
oauth2_patcher.start()
self.addCleanup(oauth2_patcher.stop)
Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 14, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 14, 2026 09:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +71 to +80
# Mock the OAuth2 client lookup for edxnotes to avoid infrastructure requirement in tests
mock_app = Mock()
mock_app.client_id = 'edx-notes-test'
mock_app.client_secret = 'test-secret'
oauth2_patcher = patch(
'lms.djangoapps.edxnotes.helpers.Application.objects.get',
return_value=mock_app,
)
oauth2_patcher.start()
self.addCleanup(oauth2_patcher.stop)
Comment on lines 210 to 215
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
)
Copilot AI review requested due to automatic review settings July 14, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +71 to +75
# Mock the OAuth2 client lookup for edxnotes to avoid infrastructure requirement in tests
oauth2_patcher = patch('lms.djangoapps.edxnotes.helpers.get_edxnotes_id_token')
mock_get_token = oauth2_patcher.start()
mock_get_token.return_value = 'test-token'
self.addCleanup(oauth2_patcher.stop)
Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 14, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +72 to +75
oauth2_patcher = patch('lms.djangoapps.edxnotes.decorators.get_edxnotes_id_token')
mock_get_token = oauth2_patcher.start()
mock_get_token.return_value = 'test-token'
self.addCleanup(oauth2_patcher.stop)
Copilot AI review requested due to automatic review settings July 14, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +71 to +74
# Mock the OAuth2 client lookup for edxnotes to avoid infrastructure requirement in tests
oauth2_patcher = patch('lms.djangoapps.edxnotes.helpers.get_edxnotes_id_token', return_value='test-token')
oauth2_patcher.start()
self.addCleanup(oauth2_patcher.stop)
Comment on lines 210 to 215
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
)
Copilot AI review requested due to automatic review settings July 14, 2026 10:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 15, 2026 06:06
@alenkadev alenkadev force-pushed the alenka/turn-Notes-on-by-default branch from 70e1a5d to 0998505 Compare July 15, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 15, 2026 07:42
@alenkadev alenkadev force-pushed the alenka/turn-Notes-on-by-default branch from 0998505 to ec551ab Compare July 15, 2026 07:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread lms/djangoapps/edxnotes/helpers.py Outdated
Comment on lines +60 to +63
log.warning(ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
)
))
return None
Comment on lines 57 to +63
try:
notes_application = Application.objects.get(name=settings.EDXNOTES_CLIENT_NAME)
except Application.DoesNotExist:
raise ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
log.warning(ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
)
))
return None
Comment on lines 57 to +63
try:
notes_application = Application.objects.get(name=settings.EDXNOTES_CLIENT_NAME)
except Application.DoesNotExist:
raise ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
log.warning(ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
)
))
return None
Copilot AI review requested due to automatic review settings July 15, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 53 to 67
def get_edxnotes_id_token(user):
"""
Returns generated ID Token for edxnotes.
"""
try:
notes_application = Application.objects.get(name=settings.EDXNOTES_CLIENT_NAME)
except Application.DoesNotExist:
raise ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
log.warning(
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
settings.EDXNOTES_CLIENT_NAME
)
return None
return create_jwt_for_user(
user, secret=notes_application.client_secret, aud=notes_application.client_id
)
Comment on lines 210 to 214
edxnotes = Boolean(
display_name=_("Enable Student Notes"),
help=_("Enter true or false. If true, students can use the Student Notes feature."),
default=False,
default=True,
scope=Scope.settings
Copilot AI review requested due to automatic review settings July 15, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment on lines 57 to +64
try:
notes_application = Application.objects.get(name=settings.EDXNOTES_CLIENT_NAME)
except Application.DoesNotExist:
raise ImproperlyConfigured( # lint-amnesty, pylint: disable=raise-missing-from
f'OAuth2 Client with name [{settings.EDXNOTES_CLIENT_NAME}] does not exist.'
log.warning(
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
settings.EDXNOTES_CLIENT_NAME
)
return None
Comment thread xmodule/tests/test_split_test_block.py Outdated
Comment on lines +126 to +127
@ddt.ddt
@patch.dict("django.conf.settings.FEATURES", {"ENABLE_EDXNOTES": False})
Copilot AI review requested due to automatic review settings July 15, 2026 11:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +60 to +64
log.warning(
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
settings.EDXNOTES_CLIENT_NAME
)
return None
Comment on lines +88 to +92
def test_app_enabled_by_default(self):
"""
Test that the app tab is disabled by default.
Test that the app tab is enabled by default.
"""
assert not self.course_app_class.is_enabled(self.course.id)
assert self.course_app_class.is_enabled(self.course.id)
Copilot AI review requested due to automatic review settings July 15, 2026 11:54
@alenkadev alenkadev force-pushed the alenka/turn-Notes-on-by-default branch from 57b1e03 to 40c1544 Compare July 15, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +60 to +64
log.warning(
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
settings.EDXNOTES_CLIENT_NAME
)
return None
Comment on lines +88 to +92
def test_app_enabled_by_default(self):
"""
Test that the app tab is disabled by default.
Test that the app tab is enabled by default.
"""
assert not self.course_app_class.is_enabled(self.course.id)
assert self.course_app_class.is_enabled(self.course.id)
Copilot AI review requested due to automatic review settings July 15, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +22 to +26
def test_app_disabled_by_default(self):
"""
Override base mixin behavior: Notes is enabled by default.
"""
assert self.course_app_class.is_enabled(self.course.id)
Comment on lines +60 to +64
log.warning(
'OAuth2 Client with name [%s] does not exist. EdxNotes will be disabled.',
settings.EDXNOTES_CLIENT_NAME
)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants