Skip to content

Commit 860dfde

Browse files
refactor: modified the imports to use openedx-events library (#29930)
* refactor: modified the imports to use openedx-events library * chore: upgrade openedx-events to latest version * fix: ran isort to avoid style errors Co-authored-by: Maria Grimaldi <[email protected]>
1 parent f9c9832 commit 860dfde

File tree

9 files changed

+12
-76
lines changed

9 files changed

+12
-76
lines changed

openedx/core/djangoapps/discussions/data.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

openedx/core/djangoapps/discussions/handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
from django.db import transaction
88

9-
from openedx.core.djangoapps.discussions.data import CourseDiscussionConfigurationData
9+
from openedx_events.learning.data import CourseDiscussionConfigurationData
10+
from openedx_events.learning.signals import COURSE_DISCUSSIONS_CHANGED
1011
from openedx.core.djangoapps.discussions.models import (
1112
DEFAULT_PROVIDER_TYPE,
1213
DiscussionTopicLink,
1314
DiscussionsConfiguration,
1415
)
15-
from openedx.core.djangoapps.discussions.signals import COURSE_DISCUSSIONS_UPDATED
1616

1717
log = logging.getLogger(__name__)
1818

@@ -98,4 +98,4 @@ def update_course_discussion_config(configuration: CourseDiscussionConfiguration
9898
).save()
9999

100100

101-
COURSE_DISCUSSIONS_UPDATED.connect(handle_course_discussion_config_update)
101+
COURSE_DISCUSSIONS_CHANGED.connect(handle_course_discussion_config_update)

openedx/core/djangoapps/discussions/signals.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

openedx/core/djangoapps/discussions/tasks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
from celery import shared_task
77
from edx_django_utils.monitoring import set_code_owner_attribute
88
from opaque_keys.edx.keys import CourseKey
9-
9+
from openedx_events.learning.data import CourseDiscussionConfigurationData, DiscussionTopicContext
10+
from openedx_events.learning.signals import COURSE_DISCUSSIONS_CHANGED
1011
from xmodule.modulestore import ModuleStoreEnum
1112
from xmodule.modulestore.django import modulestore
12-
from .data import CourseDiscussionConfigurationData, DiscussionTopicContext
13+
1314
from .models import DiscussionsConfiguration
14-
from .signals import COURSE_DISCUSSIONS_UPDATED
1515

1616
log = logging.getLogger(__name__)
1717

@@ -27,7 +27,7 @@ def update_discussions_settings_from_course_task(course_key_str: str):
2727
"""
2828
course_key = CourseKey.from_string(course_key_str)
2929
config_data = update_discussions_settings_from_course(course_key)
30-
COURSE_DISCUSSIONS_UPDATED.send_event(configuration=config_data)
30+
COURSE_DISCUSSIONS_CHANGED.send_event(configuration=config_data)
3131

3232

3333
def update_discussions_settings_from_course(course_key: CourseKey) -> CourseDiscussionConfigurationData:

openedx/core/djangoapps/discussions/tests/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.test import TestCase
99
from opaque_keys.edx.keys import CourseKey
1010

11-
from openedx.core.djangoapps.discussions.data import CourseDiscussionConfigurationData, DiscussionTopicContext
11+
from openedx_events.learning.data import CourseDiscussionConfigurationData, DiscussionTopicContext
1212
from openedx.core.djangoapps.discussions.handlers import update_course_discussion_config
1313
from openedx.core.djangoapps.discussions.models import DiscussionTopicLink, DiscussionsConfiguration
1414

openedx/core/djangoapps/discussions/tests/test_tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from xmodule.modulestore.tests.django_utils import TEST_DATA_MONGO_AMNESTY_MODULESTORE, ModuleStoreTestCase
88
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
99

10-
from openedx.core.djangoapps.discussions.data import DiscussionTopicContext
10+
from openedx_events.learning.data import DiscussionTopicContext
1111
from openedx.core.djangoapps.discussions.tasks import update_discussions_settings_from_course
1212

1313

requirements/edx/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ oauthlib==3.0.1
701701
# social-auth-core
702702
openedx-calc==3.0.1
703703
# via -r requirements/edx/base.in
704-
openedx-events==0.8.0
704+
openedx-events==0.8.1
705705
# via -r requirements/edx/base.in
706706
openedx-filters==0.5.0
707707
# via -r requirements/edx/base.in

requirements/edx/development.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ oauthlib==3.0.1
937937
# social-auth-core
938938
openedx-calc==3.0.1
939939
# via -r requirements/edx/testing.txt
940-
openedx-events==0.8.0
940+
openedx-events==0.8.1
941941
# via -r requirements/edx/testing.txt
942942
openedx-filters==0.5.0
943943
# via -r requirements/edx/testing.txt

requirements/edx/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ oauthlib==3.0.1
885885
# social-auth-core
886886
openedx-calc==3.0.1
887887
# via -r requirements/edx/base.txt
888-
openedx-events==0.8.0
888+
openedx-events==0.8.1
889889
# via -r requirements/edx/base.txt
890890
openedx-filters==0.5.0
891891
# via -r requirements/edx/base.txt

0 commit comments

Comments
 (0)