Files
edx-platform/lms/djangoapps/survey/signals.py
bmedx f3a9e508a0 Refactor retirement endpoints to isolate Sailthru and respect boundaries
- Change retire mailings endpoint to use new USER_RETIRE_THIRD_PARTY_MAILINGS signal, currently only used by Sailthru retirement
- Move USER_RETIRE_MAILINGS signal firing to the LMS misc endpoint
- Remove duplicate clearing of UserOrgTags
- Remove LMS imports in openedx/core and update usage to use new USER_RETIRE_LMS_CRITICAL and USER_RETIRE_LMS_MISC signals
- Add testing for new signal handlers and app registration for the LMS survey app
2018-06-27 10:23:49 -04:00

18 lines
502 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)