fix distinguish mod logs

pull/226/head
Aevann 2024-03-31 02:48:53 +02:00
parent 2bc1011640
commit 1f48f69814
3 changed files with 28 additions and 2 deletions

View File

@ -134,6 +134,26 @@ HOLEACTION_TYPES = {
"icon": 'fa-eye-evil',
"color": 'bg-success'
},
'distinguish_comment': {
"str": 'distinguished {self.target_link}',
"icon": 'fa-crown',
"color": 'bg-success'
},
'undistinguish_comment': {
"str": 'un-distinguished {self.target_link}',
"icon": 'fa-crown',
"color": 'bg-muted'
},
'distinguish_post': {
"str": 'distinguished {self.target_link}',
"icon": 'fa-crown',
"color": 'bg-success'
},
'undistinguish_post': {
"str": 'un-distinguished {self.target_link}',
"icon": 'fa-crown',
"color": 'bg-muted'
},
}
HOLEACTION_TYPES = dict(sorted(HOLEACTION_TYPES.items()))

View File

@ -773,7 +773,10 @@ def admin_distinguish_comment(c_id, v):
g.db.add(comment)
ma = ModAction(
if v.mods_hole(comment.post.hole): cls = HoleAction
else: cls = ModAction
ma = cls(
kind=kind,
user_id=v.id,
target_comment_id=comment.id

View File

@ -1207,7 +1207,10 @@ def distinguish_post(post_id, v):
g.db.add(post)
ma = ModAction(
if v.mods_hole(post.hole): cls = HoleAction
else: cls = ModAction
ma = cls(
kind=kind,
user_id=v.id,
target_post_id=post.id