Add an event if a user is archived

This adds a new type of event, 'archive_user', which stores the id of
the archived user and the id of the user who is doing the archiving.
This commit is contained in:
Katie Smith
2019-06-06 09:56:16 +01:00
parent 73b4aa4d85
commit f57f8641ad
4 changed files with 50 additions and 1 deletions
+7
View File
@@ -25,6 +25,13 @@ def create_mobile_number_change_event(user_id, updated_by_id, original_mobile_nu
new_mobile_number=new_mobile_number)
def create_archive_user_event(user_id, archived_by_id):
_send_event(
'archive_user',
user_id=user_id,
archived_by_id=archived_by_id)
def _send_event(event_type, **kwargs):
event_data = _construct_event_data(request)
event_data.update(kwargs)