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
ee65c878
Commit
ee65c878
authored
May 17, 2016
by
Waheed Ahmed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CourseOverview instead of modulestore.
parent
5d6362f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lms/djangoapps/certificates/signals.py
+3
-2
No files found.
lms/djangoapps/certificates/signals.py
View file @
ee65c878
...
...
@@ -6,7 +6,8 @@ from django.dispatch.dispatcher import receiver
from
certificates.models
import
CertificateGenerationCourseSetting
from
opaque_keys.edx.keys
import
CourseKey
from
xmodule.modulestore.django
import
SignalHandler
,
modulestore
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
xmodule.modulestore.django
import
SignalHandler
@receiver
(
SignalHandler
.
course_published
)
...
...
@@ -22,7 +23,7 @@ def _listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable
def
enable_self_generated_certs
(
course_key
):
"""Enable the self-generated certificates by default for self-paced courses."""
course_key
=
CourseKey
.
from_string
(
course_key
)
course
=
modulestore
()
.
get_course
(
course_key
)
course
=
CourseOverview
.
get_from_id
(
course_key
)
is_enabled_for_course
=
CertificateGenerationCourseSetting
.
is_enabled_for_course
(
course_key
)
if
course
.
self_paced
and
not
is_enabled_for_course
:
CertificateGenerationCourseSetting
.
set_enabled_for_course
(
course_key
,
True
)
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