feat: 有评论后允许删除主楼内容

This commit is contained in:
2022-06-04 14:24:47 +08:00
parent 9a33ef5a88
commit dbea8f435f
2 changed files with 13 additions and 2 deletions

View File

@@ -221,7 +221,7 @@ impl UGC for Post {
self.is_deleted
}
fn extra_delete_condition(&self) -> bool {
self.n_comments == 0 && !self.content.starts_with("[系统自动代发]\n")
!self.content.starts_with("[系统自动代发]\n")
}
async fn do_set_deleted(&mut self, db: &Db) -> API<()> {
update!(*self, posts, db, { is_deleted, to true });