Skip to content

Commit bf7d779

Browse files
fix: imports and typo
1 parent b9f039b commit bf7d779

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

cms/forms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, data=None, files=None, parent_page=None, *args, **kwargs):
5454
1. Adds choices for course_run field.
5555
2. Update course field queryset based on the page type.
5656
"""
57-
from cms.models import Course
57+
from courses.models import Course
5858

5959
super().__init__(data, files, parent_page, *args, **kwargs)
6060

courses/models.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ def clean(self):
618618
"""
619619
Ensures that is_external field is not changed if course is associated with CoursePage or ExternalCoursePage
620620
"""
621+
super().clean()
621622

622623
if not self.pk:
623624
return
@@ -643,8 +644,6 @@ def clean(self):
643644
}
644645
)
645646

646-
return super().clean()
647-
648647
def save(self, *args, **kwargs): # noqa: DJ012
649648
"""Overridden save method"""
650649
# If adding a Course to a Program without position specified, set it as the highest position + 1.

courses/models_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ def test_course_language_prevent_delete():
848848
("is_external", "page_factory"),
849849
[(True, ExternalCoursePageFactory), (False, CoursePageFactory)],
850850
)
851-
def test_is_external_field_update_after_course_is_attached_with_course_page(
851+
def test_prevent_is_external_update_after_course_page_attachment(
852852
is_external, page_factory
853853
):
854854
"""
@@ -862,11 +862,11 @@ def test_is_external_field_update_after_course_is_attached_with_course_page(
862862

863863

864864
@pytest.mark.parametrize(("is_external"), [True, False])
865-
def test_is_external_field_update_before_course_is_attached_with_course_page(
865+
def test_allow_is_external_update_before_course_page_attachment(
866866
is_external,
867867
):
868868
"""
869-
Tests that is_external field is updated bnefore a course is attached with a course page.
869+
Tests that is_external field is updated before a course is attached with a course page.
870870
"""
871871
course = CourseFactory.create(is_external=is_external, page=None)
872872
course.is_external = not is_external

0 commit comments

Comments
 (0)