Revert "EDUCATOR-394 Disable self generation certificates when course is reset to instructor-paced."

This commit is contained in:
Noraiz Anwar
2017-06-14 15:57:07 +05:00
committed by GitHub
parent c2c32e7231
commit 371c422aaf
3 changed files with 26 additions and 44 deletions

View File

@@ -5,7 +5,6 @@ import re
import logging
from django.conf import settings
from django.dispatch import Signal
from xmodule.fields import Date
from xmodule.modulestore.exceptions import ItemNotFoundError
@@ -13,8 +12,6 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.lib.courses import course_image_url
from xmodule.modulestore.django import modulestore
COURSE_PACING_CHANGE = Signal(providing_args=["course_key", "course_self_paced"])
# This list represents the attribute keys for a course's 'about' info.
# Note: The 'video' attribute is intentionally excluded as it must be
@@ -191,7 +188,6 @@ class CourseDetails(object):
descriptor = module_store.get_course(course_key)
dirty = False
is_pacing_changed = False
# In the descriptor's setter, the date is converted to JSON
# using Date's to_json method. Calling to_json on something that
@@ -275,15 +271,10 @@ class CourseDetails(object):
and jsondict['self_paced'] != descriptor.self_paced):
descriptor.self_paced = jsondict['self_paced']
dirty = True
is_pacing_changed = True
if dirty:
module_store.update_item(descriptor, user.id)
# fires a signal indicating that the course pacing has changed
if is_pacing_changed:
COURSE_PACING_CHANGE.send(sender=None, course_key=course_key, course_self_paced=descriptor.self_paced)
# NOTE: below auto writes to the db w/o verifying that any of
# the fields actually changed to make faster, could compare
# against db or could have client send over a list of which