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
1ded8b54
Commit
1ded8b54
authored
Jul 15, 2015
by
Tasawer
Committed by
zubair-arbi
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update code of get_eligibility api.
ECOM-1858
parent
ae0e21b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
common/djangoapps/student/views.py
+2
-1
lms/envs/devstack.py
+7
-0
openedx/core/djangoapps/credit/api/eligibility.py
+5
-3
No files found.
common/djangoapps/student/views.py
View file @
1ded8b54
...
...
@@ -63,6 +63,7 @@ from certificates.api import ( # pylint: disable=import-error
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.locations
import
SlashSeparatedCourseKey
from
opaque_keys.edx.locator
import
CourseLocator
from
xmodule.modulestore
import
ModuleStoreEnum
...
...
@@ -867,7 +868,7 @@ def _credit_statuses(user, course_enrollments):
statuses
=
{}
for
eligibility
in
credit_api
.
get_eligibilities_for_user
(
user
.
username
):
course_key
=
eligibility
[
"course_key"
]
course_key
=
CourseKey
.
from_string
(
unicode
(
eligibility
[
"course_key"
]))
status
=
{
"course_key"
:
unicode
(
course_key
),
"eligible"
:
True
,
...
...
lms/envs/devstack.py
View file @
1ded8b54
...
...
@@ -184,6 +184,13 @@ if FEATURES.get('ENABLE_THIRD_PARTY_AUTH') and 'third_party_auth.dummy.DummyBack
############## ECOMMERCE API CONFIGURATION SETTINGS ###############
ECOMMERCE_PUBLIC_URL_ROOT
=
"http://localhost:8002"
###################### Cross-domain requests ######################
FEATURES
[
'ENABLE_CORS_HEADERS'
]
=
True
CORS_ALLOW_CREDENTIALS
=
True
CORS_ORIGIN_WHITELIST
=
()
CORS_ORIGIN_ALLOW_ALL
=
True
#####################################################################
# See if the developer has any local overrides.
try
:
...
...
openedx/core/djangoapps/credit/api/eligibility.py
View file @
1ded8b54
...
...
@@ -13,6 +13,8 @@ from openedx.core.djangoapps.credit.models import (
CreditEligibility
,
)
from
opaque_keys.edx.keys
import
CourseKey
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -182,13 +184,13 @@ def get_eligibilities_for_user(username, course_key=None):
"""
eligibilities
=
CreditEligibility
.
get_user_eligibilities
(
username
)
if
course_key
:
eligibilities
=
eligibilities
.
filter
(
course_key
=
course_key
)
course_key
=
CourseKey
.
from_string
(
unicode
(
course_key
))
eligibilities
=
eligibilities
.
filter
(
course__course_key
=
course_key
)
return
[
{
"course_key"
:
eligibility
.
course
.
course_key
,
"course_key"
:
unicode
(
eligibility
.
course
.
course_key
)
,
"deadline"
:
eligibility
.
deadline
,
}
for
eligibility
in
eligibilities
...
...
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