forked from rDrama/rDrama
fds
parent
cb847ecd4f
commit
3e0348833e
|
@ -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/"):
|
||||||
|
try:
|
||||||
post = int(reason.split("/post/")[1].split(None, 1)[0])
|
post = int(reason.split("/post/")[1].split(None, 1)[0])
|
||||||
post = get_post(post)
|
post = get_post(post)
|
||||||
post.bannedfor = True
|
post.bannedfor = True
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
except: pass
|
||||||
elif reason.startswith("/comment/"):
|
elif reason.startswith("/comment/"):
|
||||||
|
try:
|
||||||
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
|
comment = int(reason.split("/comment/")[1].split(None, 1)[0])
|
||||||
comment = get_comment(comment)
|
comment = get_comment(comment)
|
||||||
comment.bannedfor = True
|
comment.bannedfor = True
|
||||||
g.db.add(comment)
|
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…
Reference in New Issue