From 386f8455f0dc4c7afbbc7f0f962e7a8014f21b1d Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 18 Mar 2023 08:06:54 +0200 Subject: [PATCH] fix this https://stupidpol.site/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/3816789#context --- files/helpers/config/subaction_types.py | 8 ++++---- files/routes/reporting.py | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/files/helpers/config/subaction_types.py b/files/helpers/config/subaction_types.py index a3df3d247..4d7dbefaa 100644 --- a/files/helpers/config/subaction_types.py +++ b/files/helpers/config/subaction_types.py @@ -24,10 +24,10 @@ SUBACTION_TYPES = { "icon": 'fa-feather-alt', "color": 'bg-danger' }, - 'move_chudrama': { - "str": 'moved post {self.target_link} to /h/chudrama', - "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}', diff --git a/files/routes/reporting.py b/files/routes/reporting.py index 7b3b1fa87..b5eb028e9 100644 --- a/files/routes/reporting.py +++ b/files/routes/reporting.py @@ -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: + sub_from_str = 'main feed' if sub_from is None else \ + f'/h/{sub_from}' + sub_to_str = 'main feed' if sub_to is None else \ + f'/h/{sub_to}' + if v.admin_level: - sub_from_str = 'main feed' if sub_from is None else \ - f'/h/{sub_from}' - sub_to_str = 'main feed' if sub_to is None else \ - f'/h/{sub_to}' 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)