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
7630c98b
Commit
7630c98b
authored
Nov 29, 2017
by
Albert St. Aubin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test and rebase update
parent
abf08118
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
common/djangoapps/entitlements/api/v1/tests/test_views.py
+2
-3
common/djangoapps/entitlements/api/v1/views.py
+3
-5
No files found.
common/djangoapps/entitlements/api/v1/tests/test_views.py
View file @
7630c98b
...
@@ -4,12 +4,11 @@ import uuid
...
@@ -4,12 +4,11 @@ import uuid
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.urlresolvers
import
reverse
from
django.core.urlresolvers
import
reverse
from
mock
import
patch
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.django_utils
import
ModuleStoreTestCase
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
xmodule.modulestore.tests.factories
import
CourseFactory
from
entitlements.tests.factories
import
CourseEntitlementFactory
from
student.models
import
CourseEnrollment
from
entitlements.models
import
CourseEntitlement
from
entitlements.api.v1.serializers
import
CourseEntitlementSerializer
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
,
TEST_PASSWORD
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
,
TEST_PASSWORD
# Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection
# Entitlements is not in CMS' INSTALLED_APPS so these imports will error during test collection
...
...
common/djangoapps/entitlements/api/v1/views.py
View file @
7630c98b
...
@@ -7,9 +7,7 @@ from opaque_keys.edx.keys import CourseKey
...
@@ -7,9 +7,7 @@ from opaque_keys.edx.keys import CourseKey
from
rest_framework
import
permissions
,
viewsets
,
status
from
rest_framework
import
permissions
,
viewsets
,
status
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework.authentication
import
SessionAuthentication
from
student.models
import
CourseEnrollmentException
from
student.models
import
CourseEnrollmentException
,
AlreadyEnrolledError
# from enrollment.errors import CourseEnrollmentError, CourseEnrollmentExistsError, CourseModeNotFoundError
# from openedx.core.lib.exceptions import CourseNotFoundError
from
openedx.core.djangoapps.catalog.utils
import
get_course_runs_for_course
from
openedx.core.djangoapps.catalog.utils
import
get_course_runs_for_course
from
entitlements.api.v1.filters
import
CourseEntitlementFilter
from
entitlements.api.v1.filters
import
CourseEntitlementFilter
...
@@ -26,8 +24,8 @@ log = logging.getLogger(__name__)
...
@@ -26,8 +24,8 @@ log = logging.getLogger(__name__)
class
EntitlementViewSet
(
viewsets
.
ModelViewSet
):
class
EntitlementViewSet
(
viewsets
.
ModelViewSet
):
authentication_classes
=
(
JwtAuthentication
,
SessionAuthentication
,)
authentication_classes
=
(
JwtAuthentication
,
SessionAuthentication
CrossDomainCsrf
,)
permission_classes
=
(
permissions
.
IsAuthenticated
,
permissions
.
IsAdminUser
,)
permission_classes
=
(
permissions
.
IsAuthenticated
,
IsAdminOrAuthenticatedReadOnly
,)
queryset
=
CourseEntitlement
.
objects
.
all
()
.
select_related
(
'user'
)
queryset
=
CourseEntitlement
.
objects
.
all
()
.
select_related
(
'user'
)
lookup_value_regex
=
'[0-9a-f-]+'
lookup_value_regex
=
'[0-9a-f-]+'
lookup_field
=
'uuid'
lookup_field
=
'uuid'
...
...
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