Error when deleting an episode with an existing post
Describe the bug
When deleting an episode that is referenced in a post, the activity page crashes.
Steps to reproduce
- Create an episode
- Publish the episode now (a post linked to the episode is created with it)
- Go to the activity page, the related post is shown, the episode is published
- Delete the episode
- Go to the podcast homepage, an error is shown, the page crashed
Expected behavior
The post should be deleted with the episode?
Actual behavior
The post is not deleted with the episode resulting in the page crash.
Relevant logs and/or screenshots
Context
- Castopod alpha 42
- OS: Mac OS 10.13.6
- Browser: firefox 87.0
- Web server: OVH mutu / sql 5.2
Possible fixes
Delete the note when deleting the episode? Remove the episode_id on the post when deleting the episode?
Edited by Yassine Doghri