diff --git a/files/classes/comment.py b/files/classes/comment.py index 3aeeafa29..a62a56abf 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -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) diff --git a/files/classes/submission.py b/files/classes/submission.py index c7bcc740b..89329ac26 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -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) diff --git a/files/routes/admin.py b/files/routes/admin.py index 14154d897..a9f0f5178 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -23,6 +23,16 @@ from files.helpers.discord import add_role IMGUR_KEY = environ.get("IMGUR_KEY", "").strip() +@app.post("/@/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("/@/make_admin") @admin_level_required(6) def make_admin(v, username): diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 1c7e4a175..efcea1cfd 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -462,6 +462,7 @@ {% elif v.id == 10 %} Remove admin {% endif %} + Revert admin actions {% endif %} {% if 'rdrama' in request.host and v.id in [28,29,995] %} @@ -473,6 +474,7 @@ {% else %} Remove admin {% endif %} + Revert admin actions {% endif %} {% if 'rdrama' not in request.host and 'pcm' not in request.host and v.admin_level == 6 %} @@ -481,6 +483,7 @@ {% else %} Remove admin {% endif %} + Revert admin actions {% endif %}