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
147405df
Commit
147405df
authored
Aug 18, 2017
by
Gregory Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Flag handling
parent
a506486f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
lms/djangoapps/certificates/signals.py
+10
-15
No files found.
lms/djangoapps/certificates/signals.py
View file @
147405df
...
...
@@ -24,21 +24,18 @@ log = logging.getLogger(__name__)
@receiver
(
post_save
,
sender
=
CertificateWhitelist
,
dispatch_uid
=
"append_certificate_whitelist"
)
def
_listen_for_certificate_whitelist_append
(
sender
,
instance
,
**
kwargs
):
# pylint: disable=unused-argument
switches
=
waffle
.
waffle
()
#
All
flags enabled
#
No
flags enabled
if
(
not
switches
.
is_enabled
(
waffle
.
SELF_PACED_ONLY
)
and
not
switches
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
)
):
return
# Only SELF_PACED_ONLY flag enabled
if
not
switches
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
):
if
not
courses
.
get_course_by_id
(
instance
.
course_id
,
depth
=
0
)
.
self_paced
:
if
courses
.
get_course_by_id
(
instance
.
course_id
,
depth
=
0
)
.
self_paced
:
if
not
switches
.
is_enabled
(
waffle
.
SELF_PACED_ONLY
):
return
# Only INSTRUCTOR_PACED_ONLY flag enabled
if
not
switches
.
is_enabled
(
waffle
.
SELF_PACED_ONLY
):
if
courses
.
get_course_by_id
(
instance
.
course_id
,
depth
=
0
)
.
self_paced
:
else
:
if
not
switches
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
):
return
fire_ungenerated_certificate_task
(
instance
.
user
,
instance
.
course_id
)
...
...
@@ -61,15 +58,13 @@ def _listen_for_passing_grade(sender, user, course_id, **kwargs): # pylint: dis
):
return
# Only SELF_PACED_ONLY flag enabled
if
waffle
.
waffle
()
.
is_enabled
(
waffle
.
SELF_PACED_ONLY
):
if
not
courses
.
get_course_by_id
(
course_id
,
depth
=
0
)
.
self_paced
:
if
courses
.
get_course_by_id
(
course_id
,
depth
=
0
)
.
self_paced
:
if
not
waffle
.
waffle
()
.
is_enabled
(
waffle
.
SELF_PACED_ONLY
):
return
# Only INSTRUCTOR_PACED_ONLY flag enabled
if
waffle
.
waffle
()
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
):
if
courses
.
get_course_by_id
(
course_id
,
depth
=
0
)
.
self_paced
:
else
:
if
not
waffle
.
waffle
()
.
is_enabled
(
waffle
.
INSTRUCTOR_PACED_ONLY
):
return
if
fire_ungenerated_certificate_task
(
user
,
course_id
):
log
.
info
(
u'Certificate generation task initiated for {user} : {course} via passing grade'
.
format
(
user
=
user
.
id
,
...
...
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