Skip to content

Commit

Permalink
refactor: [ACI-901] refactor code to pass ci checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii committed Apr 10, 2024
1 parent 1767642 commit 9cc978f
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion cms/djangoapps/contentstore/signals/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ def create_catalog_data_for_signal(course_key: CourseKey) -> Optional[CourseCata
enrollment_start=course.enrollment_start,
enrollment_end=course.enrollment_end,
),
effort=CourseDetails.fetch_about_attribute(course_key, 'effort'),
hidden=course.catalog_visibility in ['about', 'none'] or course_key.deprecated,
invitation_only=course.invitation_only,
)
Expand Down
2 changes: 0 additions & 2 deletions cms/djangoapps/contentstore/signals/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def setUp(self):
end=None,
enrollment_start=None,
enrollment_end=None),
short_description=None,
effort=None,
hidden=False,
invitation_only=False
)
Expand Down
5 changes: 4 additions & 1 deletion cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,10 @@ def _should_send_learning_badge_events(settings):
"enabled",
)

# If the consumer encounters this many consecutive errors, exit with an error. This is intended to be used in a context where a management system (such as Kubernetes) will relaunch the consumer automatically.
# If the consumer encounters this many consecutive errors, exit with an error.
# This is intended to be used in a context where a management system (such as Kubernetes)
# will relaunch the consumer automatically.

#EVENT_BUS_REDIS_CONSUMER_CONSECUTIVE_ERRORS_LIMIT (defaults to None)

# How long the consumer should wait for new entries in a stream.
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def course_grade_now_failed(user, course_id):
else:
COURSE_PASSING_STATUS_UPDATED.send_event(
course_passing_status=CoursePassingStatusData(
status = CoursePassingStatusData.FAILING,
status=CoursePassingStatusData.FAILING,
user=UserData(
pii=UserPersonalData(
username=user.username,
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/grades/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_persistent_grade_event_emitted(self):
)


class CoursePassingStatusEventsTest(SharedModuleStoreTestCase, OpenEdxEventsTestMixin): # pylint: disable=missing-class-docstring
class CoursePassingStatusEventsTest(SharedModuleStoreTestCase, OpenEdxEventsTestMixin): # pylint: disable=missing-class-docstring
ENABLED_OPENEDX_EVENTS = [
"org.openedx.learning.course.passing.status.updated.v1",
]
Expand Down Expand Up @@ -169,7 +169,7 @@ def test_course_passing_status_updated_emitted(self):
)


class CCXCoursePassingStatusEventsTest( # pylint: disable=missing-class-docstring
class CCXCoursePassingStatusEventsTest( # pylint: disable=missing-class-docstring
SharedModuleStoreTestCase, OpenEdxEventsTestMixin
):
ENABLED_OPENEDX_EVENTS = [
Expand Down
5 changes: 4 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5275,6 +5275,7 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
EVENT_BUS_REDIS_CONNECTION_URL = "redis://:[email protected]:6379/"
EVENT_BUS_TOPIC_PREFIX = "dev"


def _should_send_learning_badge_events(settings):
return settings.FEATURES['BADGES_ENABLED']

Expand Down Expand Up @@ -5316,7 +5317,9 @@ def _should_send_learning_badge_events(settings):
"enabled",
)

# If the consumer encounters this many consecutive errors, exit with an error. This is intended to be used in a context where a management system (such as Kubernetes) will relaunch the consumer automatically.
# If the consumer encounters this many consecutive errors, exit with an error.
# This is intended to be used in a context where a management system (such as Kubernetes)
# will relaunch the consumer automatically.
#EVENT_BUS_REDIS_CONSUMER_CONSECUTIVE_ERRORS_LIMIT (defaults to None)

# How long the consumer should wait for new entries in a stream.
Expand Down
2 changes: 1 addition & 1 deletion lms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,4 +1087,4 @@ def get_env_setting(setting):
############## Event bus producer ##############
EVENT_BUS_PRODUCER_CONFIG = merge_producer_configs(
EVENT_BUS_PRODUCER_CONFIG, ENV_TOKENS.get("EVENT_BUS_PRODUCER_CONFIG", {})
)
)

0 comments on commit 9cc978f

Please sign in to comment.