Clear node messages on deletion (#419)

## Summary of the Pull Request

_What is this about?_

## PR Checklist
* [ ] Applies to work item: #xxx
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/onefuzz) and sign the CLI.
* [ ] Tests added/passed
* [ ] Requires documentation to be updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

## Info on Pull Request

_What does this include?_

## Validation Steps Performed

_How does someone test & validate?_
This commit is contained in:
Cheick Keita
2021-01-11 12:14:43 -08:00
committed by GitHub
parent 5f9110f97b
commit d573100a97

View File

@ -318,6 +318,7 @@ class Node(BASE_NODE, ORMMixin):
def delete(self) -> None:
NodeTasks.clear_by_machine_id(self.machine_id)
super().delete()
NodeMessage.clear_messages(self.machine_id)
class NodeTasks(BASE_NODE_TASK, ORMMixin):