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
97ef7397
Commit
97ef7397
authored
Mar 08, 2016
by
Ibrahim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return course end date in credit service and rename flag
parent
7bdc762e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
openedx/core/djangoapps/credit/services.py
+4
-2
openedx/core/djangoapps/credit/tests/test_services.py
+1
-1
No files found.
openedx/core/djangoapps/credit/services.py
View file @
97ef7397
...
...
@@ -48,7 +48,7 @@ class CreditService(object):
return
is_credit_course
(
course_key
)
def
get_credit_state
(
self
,
user_id
,
course_key_or_id
,
return_course_
name
=
False
):
def
get_credit_state
(
self
,
user_id
,
course_key_or_id
,
return_course_
info
=
False
):
"""
Return all information about the user's credit state inside of a given
course.
...
...
@@ -66,6 +66,7 @@ class CreditService(object):
'is_credit_course': if the course has been marked as a credit bearing course
'credit_requirement_status': the user's status in fulfilling those requirements
'course_name': optional display name of the course
'course_end_date': optional end date of the course
}
"""
...
...
@@ -99,10 +100,11 @@ class CreditService(object):
'credit_requirement_status'
:
get_credit_requirement_status
(
course_key
,
user
.
username
)
}
if
return_course_
name
:
if
return_course_
info
:
course
=
modulestore
()
.
get_course
(
course_key
,
depth
=
0
)
result
.
update
({
'course_name'
:
course
.
display_name
,
'course_end_date'
:
course
.
end
,
})
return
result
...
...
openedx/core/djangoapps/credit/tests/test_services.py
View file @
97ef7397
...
...
@@ -253,7 +253,7 @@ class CreditServiceTests(ModuleStoreTestCase):
self
.
assertNotIn
(
'course_name'
,
credit_state
)
# now make sure it is in there when we pass in the flag
credit_state
=
self
.
service
.
get_credit_state
(
self
.
user
.
id
,
self
.
course
.
id
,
return_course_
name
=
True
)
credit_state
=
self
.
service
.
get_credit_state
(
self
.
user
.
id
,
self
.
course
.
id
,
return_course_
info
=
True
)
self
.
assertIn
(
'course_name'
,
credit_state
)
self
.
assertEqual
(
credit_state
[
'course_name'
],
self
.
course
.
display_name
)
...
...
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