forked from MarseyWorld/MarseyWorld
master
parent
2c95c75940
commit
386f8455f0
|
@ -24,10 +24,10 @@ SUBACTION_TYPES = {
|
|||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-danger'
|
||||
},
|
||||
'move_chudrama': {
|
||||
"str": 'moved post {self.target_link} to <a href="/h/chudrama">/h/chudrama</a>',
|
||||
"icon": 'fa-feather-alt',
|
||||
"color": 'bg-danger'
|
||||
'move_hole': {
|
||||
"str": 'changed hole of {self.target_link}',
|
||||
"icon": 'fa-manhole',
|
||||
"color": 'bg-primary'
|
||||
},
|
||||
'flair_post': {
|
||||
"str": 'set a flair on {self.target_link}',
|
||||
|
|
|
@ -181,11 +181,12 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
|
|||
g.db.add(post)
|
||||
|
||||
if v.id != post.author_id:
|
||||
if v.admin_level:
|
||||
sub_from_str = 'main feed' if sub_from is None else \
|
||||
f'<a href="/h/{sub_from}">/h/{sub_from}</a>'
|
||||
sub_to_str = 'main feed' if sub_to is None else \
|
||||
f'<a href="/h/{sub_to}">/h/{sub_to}</a>'
|
||||
|
||||
if v.admin_level:
|
||||
ma = ModAction(
|
||||
kind='move_hole',
|
||||
user_id=v.id,
|
||||
|
@ -199,9 +200,10 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
|
|||
else:
|
||||
ma = SubAction(
|
||||
sub=sub_from,
|
||||
kind='move_chudrama',
|
||||
kind='move_hole',
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue