From 3d24827973030d73d0878cc82a915f6fdfe8bad1 Mon Sep 17 00:00:00 2001 From: "adeel.tajamul" Date: Mon, 4 Apr 2022 14:55:31 +0500 Subject: [PATCH] fix: adding empty live configuration --- openedx/core/djangoapps/course_live/plugins.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openedx/core/djangoapps/course_live/plugins.py b/openedx/core/djangoapps/course_live/plugins.py index c569ee7335..f060a2419d 100644 --- a/openedx/core/djangoapps/course_live/plugins.py +++ b/openedx/core/djangoapps/course_live/plugins.py @@ -47,9 +47,7 @@ class LiveCourseApp(CourseApp): """ Set live enabled status in CourseLiveConfiguration model. """ - configuration = CourseLiveConfiguration.get(course_key) - if configuration is None: - raise ValueError("Can't enable/disable live for course before it is configured.") + configuration, _ = CourseLiveConfiguration.objects.get_or_create(course_key=course_key) configuration.enabled = enabled configuration.save() return configuration.enabled