Skip to content

Commit

Permalink
fix: add missing end field (#34880)
Browse files Browse the repository at this point in the history
* fix: add missing end field

* fix: lint and test errors
  • Loading branch information
KristinAoki authored May 31, 2024
1 parent 3b2971e commit 1ef4c0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ def test_rerun(self):
dest_course_key = CourseKey.from_string(data['destination_course_key'])

self.assertEqual(dest_course_key.run, 'copy')
source_course = self.store.get_course(self.source_course_key)
dest_course = self.store.get_course(dest_course_key)
self.assertEqual(dest_course.start, CourseFields.start.default)
self.assertEqual(dest_course.end, source_course.end)
self.assertEqual(dest_course.end, None)
self.assertEqual(dest_course.enrollment_start, None)
self.assertEqual(dest_course.enrollment_end, None)
course_orgs = get_course_organizations(dest_course_key)
Expand Down
3 changes: 2 additions & 1 deletion cms/djangoapps/contentstore/views/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,7 @@ def _create_or_rerun_course(request):
display_name = request.json.get('display_name')
# force the start date for reruns and allow us to override start via the client
start = request.json.get('start', CourseFields.start.default)
end = request.json.get('end', CourseFields.end.default)
run = request.json.get('run')
has_course_creator_role = is_content_creator(request.user, org)

Expand All @@ -892,7 +893,7 @@ def _create_or_rerun_course(request):
status=400
)

fields = {'start': start}
fields = {'start': start, 'end': end}
if display_name is not None:
fields['display_name'] = display_name

Expand Down

0 comments on commit 1ef4c0d

Please sign in to comment.