From 0a4931ec5d5c2216756b1ca2d744d2e5ff3f0cea Mon Sep 17 00:00:00 2001 From: Gregory Martin Date: Mon, 15 May 2017 16:13:00 -0400 Subject: [PATCH 1/2] Implement GPC signal --- cms/djangoapps/contentstore/signals.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/signals.py b/cms/djangoapps/contentstore/signals.py index 4be065214b..57448c6e2e 100644 --- a/cms/djangoapps/contentstore/signals.py +++ b/cms/djangoapps/contentstore/signals.py @@ -4,7 +4,7 @@ import logging from datetime import datetime from pytz import UTC -from django.dispatch import receiver +from django.dispatch import receiver, Signal from xmodule.modulestore.django import modulestore, SignalHandler from contentstore.courseware_index import CoursewareSearchIndexer, LibrarySearchIndexer @@ -17,6 +17,18 @@ from util.module_utils import yield_dynamic_descriptor_descendants log = logging.getLogger(__name__) +# Signal that indicates that a course grading policy has been updated. +# This signal is generated when a grading policy change occurs within +# modulestore for either course or subsection changes. +GRADING_POLICY_CHANGED = Signal( + providing_args=[ + 'user_id', # Integer User ID + 'course_id', # Unicode string representing the course + 'modified' # A datetime indicating when the signal was fired + ] +) + + @receiver(SignalHandler.course_published) def listen_for_course_publish(sender, course_key, **kwargs): # pylint: disable=unused-argument """ From 70b83f9f20c4ea46e81eb36f29c7d79bf7ef3f41 Mon Sep 17 00:00:00 2001 From: Gregory Martin Date: Mon, 15 May 2017 16:49:59 -0400 Subject: [PATCH 2/2] elim datetime --- cms/djangoapps/contentstore/signals.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cms/djangoapps/contentstore/signals.py b/cms/djangoapps/contentstore/signals.py index 57448c6e2e..cf0806614e 100644 --- a/cms/djangoapps/contentstore/signals.py +++ b/cms/djangoapps/contentstore/signals.py @@ -24,7 +24,6 @@ GRADING_POLICY_CHANGED = Signal( providing_args=[ 'user_id', # Integer User ID 'course_id', # Unicode string representing the course - 'modified' # A datetime indicating when the signal was fired ] )