Files
edx-platform/lms/djangoapps/survey/signals.py
Feanil Patel 9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00

19 lines
503 B
Python

"""
Signal handlers for the survey app
"""
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)