fds
This commit is contained in:
parent
2c82cfac58
commit
ed63eb08be
1 changed files with 12 additions and 8 deletions
|
@ -1177,15 +1177,19 @@ def ban_user(user_id, v):
|
||||||
|
|
||||||
if 'reason' in request.values:
|
if 'reason' in request.values:
|
||||||
if reason.startswith("/post/"):
|
if reason.startswith("/post/"):
|
||||||
post = int(reason.split("/post/")[1].split(None, 1)[0])
|
try:
|
||||||
post = get_post(post)
|
post = int(reason.split("/post/")[1].split(None, 1)[0])
|
||||||
post.bannedfor = True
|
post = get_post(post)
|
||||||
g.db.add(post)
|
post.bannedfor = True
|
||||||
|
g.db.add(post)
|
||||||
|
except: pass
|
||||||
elif reason.startswith("/comment/"):
|
elif reason.startswith("/comment/"):
|
||||||
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
|
try:
|
||||||
comment = get_comment(comment)
|
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
|
||||||
comment.bannedfor = True
|
comment = get_comment(comment)
|
||||||
g.db.add(comment)
|
comment.bannedfor = True
|
||||||
|
g.db.add(comment)
|
||||||
|
except: pass
|
||||||
|
|
||||||
|
|
||||||
body = f"@{v.username} has banned @{user.username} ({note})"
|
body = f"@{v.username} has banned @{user.username} ({note})"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue