remotes/1693045480750635534/spooky-22
Aevann1 2021-09-10 07:28:09 +02:00
parent a22b2c8275
commit 0ec50061a0
4 changed files with 15 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
created_utc = Column(Integer, default=0)
edited_utc = Column(Integer, default=0)
is_banned = Column(Boolean, default=False)
removed_by = Column(int)
bannedfor = Column(Boolean)
distinguish_level = Column(Integer, default=0)
deleted_utc = Column(Integer, default=0)

View File

@ -44,6 +44,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
created_utc = Column(BigInteger, default=0)
thumburl = Column(String)
is_banned = Column(Boolean, default=False)
removed_by = Column(int)
bannedfor = Column(Boolean)
processing = Column(Boolean, default=False)
views = Column(Integer, default=0)

View File

@ -23,6 +23,16 @@ from files.helpers.discord import add_role
IMGUR_KEY = environ.get("IMGUR_KEY", "").strip()
@app.post("/@<username>/revert_actions")
@admin_level_required(6)
def revert_actions(v, username):
user = get_user(username)
if not user: abort(404)
items = g.db.query(Submission, Comment).options(lazyload('*')).all()
print(items)
return {"message": "User has been made admin!"}
@app.post("/@<username>/make_admin")
@admin_level_required(6)
def make_admin(v, username):

View File

@ -462,6 +462,7 @@
{% elif v.id == 10 %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/remove_admin')">Remove admin</a>
{% endif %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/revert_actions')">Revert admin actions</a>
{% endif %}
{% if 'rdrama' in request.host and v.id in [28,29,995] %}
@ -473,6 +474,7 @@
{% else %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/remove_admin')">Remove admin</a>
{% endif %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/revert_actions')">Revert admin actions</a>
{% endif %}
{% if 'rdrama' not in request.host and 'pcm' not in request.host and v.admin_level == 6 %}
@ -481,6 +483,7 @@
{% else %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/remove_admin')">Remove admin</a>
{% endif %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/revert_actions')">Revert admin actions</a>
{% endif %}
<form class="d-none profile-toggleable-mobile" id='message-mobile' action="/@{{u.username}}/message" method="post">