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
29a1df33
Commit
29a1df33
authored
Oct 11, 2017
by
Simon Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Exposing course run license via Course API"
This reverts commit
a1419b15
.
parent
db6570b7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
46 deletions
+3
-46
lms/djangoapps/course_api/serializers.py
+0
-1
lms/djangoapps/course_api/tests/test_serializers.py
+2
-12
openedx/core/djangoapps/content/course_overviews/migrations/0015_courseoverview_license.py
+0
-19
openedx/core/djangoapps/content/course_overviews/models.py
+1
-3
openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
+0
-11
No files found.
lms/djangoapps/course_api/serializers.py
View file @
29a1df33
...
...
@@ -74,7 +74,6 @@ class CourseSerializer(serializers.Serializer): # pylint: disable=abstract-meth
mobile_available
=
serializers
.
BooleanField
()
hidden
=
serializers
.
SerializerMethodField
()
invitation_only
=
serializers
.
BooleanField
()
license
=
serializers
.
CharField
()
# 'course_id' is a deprecated field, please use 'id' instead.
course_id
=
serializers
.
CharField
(
source
=
'id'
,
read_only
=
True
)
...
...
lms/djangoapps/course_api/tests/test_serializers.py
View file @
29a1df33
...
...
@@ -17,10 +17,9 @@ from openedx.core.djangoapps.models.course_details import CourseDetails
from
xmodule.course_module
import
DEFAULT_START_DATE
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
check_mongo_calls
from
.mixins
import
CourseApiFactoryMixin
from
..serializers
import
CourseDetailSerializer
,
CourseSerializer
LICENSE
=
'all-rights-reserved'
from
..serializers
import
CourseDetailSerializer
,
CourseSerializer
from
.mixins
import
CourseApiFactoryMixin
@attr
(
shard
=
3
)
...
...
@@ -74,20 +73,11 @@ class TestCourseSerializer(CourseApiFactoryMixin, ModuleStoreTestCase):
'mobile_available'
:
False
,
'hidden'
:
False
,
'invitation_only'
:
False
,
'license'
:
LICENSE
,
# 'course_id' is a deprecated field, please use 'id' instead.
'course_id'
:
u'edX/toy/2012_Fall'
,
}
@staticmethod
def
create_course
(
**
kwargs
):
combined_kwargs
=
{
'license'
:
LICENSE
,
}
combined_kwargs
.
update
(
kwargs
)
return
CourseApiFactoryMixin
.
create_course
(
**
combined_kwargs
)
def
_get_request
(
self
,
user
=
None
):
"""
Build a Request object for the specified user.
...
...
openedx/core/djangoapps/content/course_overviews/migrations/0015_courseoverview_license.py
deleted
100644 → 0
View file @
db6570b7
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'course_overviews'
,
'0014_courseoverview_certificate_available_date'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'courseoverview'
,
name
=
'license'
,
field
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
),
),
]
openedx/core/djangoapps/content/course_overviews/models.py
View file @
29a1df33
...
...
@@ -44,7 +44,7 @@ class CourseOverview(TimeStampedModel):
app_label
=
'course_overviews'
# IMPORTANT: Bump this whenever you modify this model and/or add a migration.
VERSION
=
7
VERSION
=
6
# Cache entry versioning.
version
=
IntegerField
()
...
...
@@ -103,7 +103,6 @@ class CourseOverview(TimeStampedModel):
eligible_for_financial_aid
=
BooleanField
(
default
=
True
)
language
=
TextField
(
null
=
True
)
license
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
)
@classmethod
def
_create_or_update
(
cls
,
course
):
...
...
@@ -196,7 +195,6 @@ class CourseOverview(TimeStampedModel):
course_overview
.
self_paced
=
course
.
self_paced
course_overview
.
language
=
course
.
language
course_overview
.
license
=
course
.
license
or
''
return
course_overview
...
...
openedx/core/djangoapps/content/course_overviews/tests/test_course_overviews.py
View file @
29a1df33
...
...
@@ -508,17 +508,6 @@ class CourseOverviewTestCase(ModuleStoreTestCase):
self
.
assertEqual
(
len
(
course_ids_to_overviews
),
1
)
self
.
assertIn
(
course_with_overview_1
.
id
,
course_ids_to_overviews
)
@ddt.data
(
(
''
,
''
,),
(
None
,
''
,),
(
'all-rights-reserved'
,
'all-rights-reserved'
,),
)
@ddt.unpack
def
test_license
(
self
,
license
,
expected_value
):
course
=
CourseFactory
.
create
(
emit_signals
=
True
,
license
=
license
)
course_overview
=
CourseOverview
.
get_from_id
(
course
.
id
)
self
.
assertEqual
(
course_overview
.
license
,
expected_value
)
@attr
(
shard
=
3
)
@ddt.ddt
...
...
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