Add queue information to user delete task chain

This commit is contained in:
Jan Dittberner 2023-05-07 14:47:30 +02:00
parent 175ffd19f4
commit 8c7af9a246

View file

@ -338,14 +338,17 @@ def handle_user_deleted(sender, instance, **kwargs):
}
"""
chain = (
delete_file_mail_userdir.s(instance.username)
| delete_file_sftp_userdir_chained.s()
| delete_ldap_user_chained.s()
)
file_task_1 = delete_file_mail_userdir.s(instance.username).set(queue="file")
file_task_2 = delete_file_sftp_userdir_chained.s().set(queue="file")
ldap_task_1 = delete_ldap_user_chained.s().set(queue="ldap")
chain = file_task_1 | file_task_2 | ldap_task_1
_LOGGER.debug("chain signature %s", chain)
taskresult = TaskResult.objects.create_task_result("handle_user_deleted", chain)
_LOGGER.info("LDAP user deletion has been requested in task %s", taskresult.task_id)
task_result = TaskResult.objects.create_task_result("handle_user_deleted", chain)
_LOGGER.info(
"LDAP user deletion has been requested in task %s", task_result.task_id
)
@receiver(post_delete, sender=AdditionalGroup)