forum: do not delete threads of promoted topics

Threads of promoted topics belong to the programs they were promoted
into, so they shouldn't be deleted.
This commit is contained in:
Lephe 2021-07-12 20:20:33 +02:00
parent a6689312cf
commit 76f03be60f
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ class Topic(Post):
def delete(self):
"""Recursively delete topic and all associated contents."""
self.thread.delete()
if self.promotion is None:
self.thread.delete()
db.session.delete(self)
def __repr__(self):