Files
edx-platform/lms/djangoapps/survey/signals.py
Stu Young 367736614d INCR-259 Run python-modernize on lms/djangoapps/survey (#20561)
* run python modernize

* run isort
2019-05-21 11:35:25 -04:00

19 lines
541 B
Python

"""
Signal handlers for the survey app
"""
from __future__ import absolute_import
from django.dispatch.dispatcher import receiver
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_MISC
from survey.models import SurveyAnswer
@receiver(USER_RETIRE_LMS_MISC)
def _listen_for_lms_retire(sender, **kwargs): # pylint: disable=unused-argument
"""
Listener for the USER_RETIRE_LMS_MISC signal, just does the SurveyAnswer retirement
"""
user = kwargs.get('user')
SurveyAnswer.retire_user(user.id)