Files
edx-platform/openedx/core/djangoapps/signals/signals.py
Ana Maria Rodriguez 75cae7ebd2 INCR-174
Run python-modernize on openedx/core/djangoapps/heartbeat and openedx/core/djangoapps/signals
2019-04-24 14:07:32 -05:00

35 lines
1.3 KiB
Python

"""
This module contains all general use signals.
"""
from __future__ import absolute_import
from django.dispatch import Signal
# Signal that fires when a user is graded
COURSE_GRADE_CHANGED = Signal(providing_args=["user", "course_grade", "course_key", "deadline"])
# Signal that fires when a user is awarded a certificate in a course (in the certificates django app)
# TODO: runtime coupling between apps will be reduced if this event is changed to carry a username
# rather than a User object; however, this will require changes to the milestones and badges APIs
COURSE_CERT_CHANGED = Signal(providing_args=["user", "course_key", "mode", "status"])
COURSE_CERT_AWARDED = Signal(providing_args=["user", "course_key", "mode", "status"])
# Signal that indicates that a user has passed a course.
COURSE_GRADE_NOW_PASSED = Signal(
providing_args=[
'user', # user object
'course_id', # course.id
]
)
#Signal that indicates a user is now failing a course that they had previously passed.
COURSE_GRADE_NOW_FAILED = Signal(
providing_args=[
'user', # user object
'course_id', # course.id
'grade', # CourseGrade object
]
)
# Signal that indicates that a user has become verified
LEARNER_NOW_VERIFIED = Signal(providing_args=['user'])