Commit a8913f9a by rabia23

Review Alex

parent bb219ed4
...@@ -15,11 +15,11 @@ def _listen_for_course_publish(sender, course_key, course_self_paced, **kwargs): ...@@ -15,11 +15,11 @@ def _listen_for_course_publish(sender, course_key, course_self_paced, **kwargs):
Catches the signal that course pacing has changed and enable/disable Catches the signal that course pacing has changed and enable/disable
the self-generated certificates according to course-pacing. the self-generated certificates according to course-pacing.
""" """
enable_self_generated_certs.delay(unicode(course_key), course_self_paced) toggle_self_generated_certs.delay(unicode(course_key), course_self_paced)
@task() @task()
def enable_self_generated_certs(course_key, course_self_paced): def toggle_self_generated_certs(course_key, course_self_paced):
""" """
Enable or disable self-generated certificates for a course according to pacing. Enable or disable self-generated certificates for a course according to pacing.
""" """
......
...@@ -191,7 +191,6 @@ class CourseDetails(object): ...@@ -191,7 +191,6 @@ class CourseDetails(object):
descriptor = module_store.get_course(course_key) descriptor = module_store.get_course(course_key)
dirty = False dirty = False
is_pacing_changed = False
# In the descriptor's setter, the date is converted to JSON # In the descriptor's setter, the date is converted to JSON
# using Date's to_json method. Calling to_json on something that # using Date's to_json method. Calling to_json on something that
...@@ -275,7 +274,8 @@ class CourseDetails(object): ...@@ -275,7 +274,8 @@ class CourseDetails(object):
and jsondict['self_paced'] != descriptor.self_paced): and jsondict['self_paced'] != descriptor.self_paced):
descriptor.self_paced = jsondict['self_paced'] descriptor.self_paced = jsondict['self_paced']
dirty = True dirty = True
is_pacing_changed = True # sends out the signal that course pacing has changed
COURSE_PACING_CHANGE.send(sender=None, course_key=course_key, course_self_paced=descriptor.self_paced)
if dirty: if dirty:
module_store.update_item(descriptor, user.id) module_store.update_item(descriptor, user.id)
...@@ -290,10 +290,6 @@ class CourseDetails(object): ...@@ -290,10 +290,6 @@ class CourseDetails(object):
cls.update_about_video(descriptor, jsondict['intro_video'], user.id) cls.update_about_video(descriptor, jsondict['intro_video'], user.id)
if is_pacing_changed:
# sends out the signal that course pacing has changed
COURSE_PACING_CHANGE.send(sender=None, course_key=course_key, course_self_paced=descriptor.self_paced)
# Could just return jsondict w/o doing any db reads, but I put # Could just return jsondict w/o doing any db reads, but I put
# the reads in as a means to confirm it persisted correctly # the reads in as a means to confirm it persisted correctly
return CourseDetails.fetch(course_key) return CourseDetails.fetch(course_key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment