Aevann 2023-03-18 08:06:54 +02:00
parent 2c95c75940
commit 386f8455f0
2 changed files with 12 additions and 10 deletions

View File

@ -24,10 +24,10 @@ SUBACTION_TYPES = {
"icon": 'fa-feather-alt', "icon": 'fa-feather-alt',
"color": 'bg-danger' "color": 'bg-danger'
}, },
'move_chudrama': { 'move_hole': {
"str": 'moved post {self.target_link} to <a href="/h/chudrama">/h/chudrama</a>', "str": 'changed hole of {self.target_link}',
"icon": 'fa-feather-alt', "icon": 'fa-manhole',
"color": 'bg-danger' "color": 'bg-primary'
}, },
'flair_post': { 'flair_post': {
"str": 'set a flair on {self.target_link}', "str": 'set a flair on {self.target_link}',

View File

@ -181,11 +181,12 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
g.db.add(post) g.db.add(post)
if v.id != post.author_id: if v.id != post.author_id:
if v.admin_level:
sub_from_str = 'main feed' if sub_from is None else \ sub_from_str = 'main feed' if sub_from is None else \
f'<a href="/h/{sub_from}">/h/{sub_from}</a>' f'<a href="/h/{sub_from}">/h/{sub_from}</a>'
sub_to_str = 'main feed' if sub_to is None else \ sub_to_str = 'main feed' if sub_to is None else \
f'<a href="/h/{sub_to}">/h/{sub_to}</a>' f'<a href="/h/{sub_to}">/h/{sub_to}</a>'
if v.admin_level:
ma = ModAction( ma = ModAction(
kind='move_hole', kind='move_hole',
user_id=v.id, user_id=v.id,
@ -199,9 +200,10 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
else: else:
ma = SubAction( ma = SubAction(
sub=sub_from, sub=sub_from,
kind='move_chudrama', kind='move_hole',
user_id=v.id, user_id=v.id,
target_submission_id=post.id target_submission_id=post.id,
_note=f'{sub_from_str}{sub_to_str}',
) )
g.db.add(ma) g.db.add(ma)