add mod action if JL3 kicks post from hole (#377)

* add mod action if JL3 kicks from hole

* don't be dumb
remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-09-27 15:09:08 -07:00 committed by GitHub
parent b2b63ee23e
commit e5de8cc66c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -356,6 +356,16 @@ def kick(v, pid):
old = post.sub
post.sub = None
if v.admin_level >= 3 and v.id != post.author_id:
old_str = f'<a href="/h/{old}">/h/{old}</a>'
ma = ModAction(
kind='move_hole',
user_id=v.id,
target_submission_id=post.id,
_note=f'{old_str} → main feed',
)
g.db.add(ma)
g.db.add(post)
cache.delete_memoized(frontlist)
@ -566,4 +576,4 @@ def sub_stealth(v, sub):
if sub.stealth:
return {"message": f"Stealth mode has been enabled for /h/{sub} successfully!"}
else:
return {"message": f"Stealth mode has been disabled for /h/{sub} successfully!"}
return {"message": f"Stealth mode has been disabled for /h/{sub} successfully!"}