Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
7d51c194
Commit
7d51c194
authored
7 years ago
by
Clinton Blackburn
Committed by
Clinton Blackburn
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Studio course run API endpoint to allow null enrollment dates
LEARNER-2469
parent
dd949fad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
cms/djangoapps/api/v1/serializers/course_runs.py
+1
-1
cms/djangoapps/api/v1/tests/test_views/test_course_runs.py
+3
-5
No files found.
cms/djangoapps/api/v1/serializers/course_runs.py
View file @
7d51c194
...
...
@@ -28,7 +28,7 @@ class CourseAccessRoleSerializer(serializers.ModelSerializer):
class
CourseRunScheduleSerializer
(
serializers
.
Serializer
):
start
=
serializers
.
DateTimeField
()
end
=
serializers
.
DateTimeField
()
enrollment_start
=
serializers
.
DateTimeField
()
enrollment_start
=
serializers
.
DateTimeField
(
allow_null
=
True
)
enrollment_end
=
serializers
.
DateTimeField
(
allow_null
=
True
)
...
...
This diff is collapsed.
Click to expand it.
cms/djangoapps/api/v1/tests/test_views/test_course_runs.py
View file @
7d51c194
...
...
@@ -237,8 +237,6 @@ class CourseRunViewSetTests(ModuleStoreTestCase):
course_run
=
ToyCourseFactory
()
start
=
datetime
.
datetime
.
now
(
pytz
.
UTC
)
.
replace
(
microsecond
=
0
)
end
=
start
+
datetime
.
timedelta
(
days
=
30
)
enrollment_start
=
start
-
datetime
.
timedelta
(
days
=
7
)
enrollment_end
=
end
-
datetime
.
timedelta
(
days
=
14
)
user
=
UserFactory
()
role
=
'instructor'
run
=
'3T2017'
...
...
@@ -248,8 +246,8 @@ class CourseRunViewSetTests(ModuleStoreTestCase):
'schedule'
:
{
'start'
:
serialize_datetime
(
start
),
'end'
:
serialize_datetime
(
end
),
'enrollment_start'
:
serialize_datetime
(
enrollment_start
)
,
'enrollment_end'
:
serialize_datetime
(
enrollment_end
)
,
'enrollment_start'
:
None
,
'enrollment_end'
:
None
,
},
'team'
:
[
{
...
...
@@ -264,7 +262,7 @@ class CourseRunViewSetTests(ModuleStoreTestCase):
course_run_key
=
CourseKey
.
from_string
(
response
.
data
[
'id'
])
course_run
=
modulestore
()
.
get_course
(
course_run_key
)
assert
course_run
.
id
.
run
==
run
self
.
assert_course_run_schedule
(
course_run
,
start
,
end
,
enrollment_start
,
enrollment_end
)
self
.
assert_course_run_schedule
(
course_run
,
start
,
end
,
None
,
None
)
self
.
assert_access_role
(
course_run
,
user
,
role
)
self
.
assert_course_access_role_count
(
course_run
,
1
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment