remotes/1693045480750635534/spooky-22
Aevann1 2021-09-25 20:29:41 +02:00
parent 8e9ca8ef86
commit b9e9e6cf12
4 changed files with 19 additions and 25 deletions

View File

@ -906,16 +906,19 @@ def ban_user(user_id, v):
if 'reason' in request.values:
if reason.startswith("/post/"):
post = reason.split("/post/")[1]
post = get_post(post)
post.bannedfor = True
g.db.add(post)
try:
post = int(reason.split("/post/")[1])
post = get_post(post)
post.bannedfor = True
g.db.add(post)
except: pass
elif reason.startswith("/comment/"):
comment = reason.split("/comment/")[1]
comment = get_comment(comment)
comment.bannedfor = True
g.db.add(comment)
try:
comment = int(reason.split("/comment/")[1])
comment = get_comment(comment)
comment.bannedfor = True
g.db.add(comment)
except: pass
g.db.commit()
if 'redir' in request.values: return (redirect(user.url), user)

View File

@ -549,6 +549,9 @@
{% include "emoji_modal.html" %}
{% include "award_modal.html" %}
{% include "delete_comment_modal.html" %}
{% if v.admin_level == 6 %}
{% include "ban_modal.html" %}
{% endif %}
{% endif %}
{% include "expanded_image_modal.html" %}
{% include "flag_comment_modal.html" %}

View File

@ -1353,21 +1353,6 @@
</div>
</div>
{% if v %}
{% include "award_modal.html" %}
{% include "flag_post_modal.html" %}
{% include "flag_comment_modal.html" %}
{% include "gif_modal.html" %}
{% include "delete_comment_modal.html" %}
{% include "delete_post_modal.html" %}
{% if v.admin_level > 1 %}
{% include "ban_modal.html" %}
{% endif %}
{% endif %}
{% include "expanded_image_modal.html" %}
<script src="/assets/js/general39.js"></script>

View File

@ -520,6 +520,9 @@
{% if v %}
{% include "award_modal.html" %}
{% include "delete_post_modal.html" %}
{% if v.admin_level == 6 %}
{% include "ban_modal.html" %}
{% endif %}
{% endif %}
{% include "expanded_image_modal.html" %}
{% include "flag_post_modal.html" %}
{% include "flag_post_modal.html" %}