diff --git a/files/routes/admin.py b/files/routes/admin.py index 810cc3256..8808bfdb2 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -23,6 +23,15 @@ if SITE_NAME == 'PCM': cc = "splash mountain" else: cc = "country club" month = datetime.now().strftime('%B') +@app.get("/admin/grassed") +@admin_level_required(3) +def grassed(v): + users = g.db.query(User).filter(User.ban_reason.like('grass award used by @%')).all() + + if not v or v.oldsite: template = '' + else: template = 'CHRISTMAS/' + return render_template(f"{template}grassed.html", v=v, users=users) + @app.get("/distribute/") @admin_level_required(3) def distribute(v, cid): @@ -262,7 +271,6 @@ def shadowbanned(v): else: template = 'CHRISTMAS/' return render_template(f"{template}shadowbanned.html", v=v, users=users) - @app.get("/admin/agendaposters") @auth_required def agendaposters(v): @@ -887,6 +895,7 @@ def unban_user(user_id, v): user.is_banned = 0 user.unban_utc = 0 user.ban_evade = 0 + user.ban_reason = None g.db.add(user) if request.values.get("alts", ""): diff --git a/files/routes/awards.py b/files/routes/awards.py index bfd36e96c..11f5f91d0 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -240,6 +240,7 @@ def award_post(pid, v): author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}" link = f"[this post]({post.permalink})" send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!") + send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{post.shortlink}]({post.shortlink})") elif kind == "pin": if post.stickied and post.stickied.startswith("t:"): t = int(post.stickied[2:]) + 3600 else: t = int(time.time()) + 3600 @@ -411,6 +412,7 @@ def award_comment(cid, v): author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}" link = f"[this comment]({c.permalink})" send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!") + send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{c.shortlink}]({c.shortlink})") elif kind == "pin": if c.is_pinned and c.is_pinned.startswith("t:"): t = int(c.is_pinned[2:]) + 3600 else: t = int(time.time()) + 3600 diff --git a/files/templates/CHRISTMAS/grassed.html b/files/templates/CHRISTMAS/grassed.html new file mode 100644 index 000000000..0c7ce6142 --- /dev/null +++ b/files/templates/CHRISTMAS/grassed.html @@ -0,0 +1,21 @@ +{% extends "CHRISTMAS/settings2.html" %} + +{% block content %} + + + + + + + + +{% for user in users %} + + + + + +{% endfor %} +
#NameGrasser
{{loop.index}}{{user.username}}{{user.ban_reason.split('by ')[1]}}
+ +{% endblock %} diff --git a/files/templates/grassed.html b/files/templates/grassed.html new file mode 100644 index 000000000..40cbc1bf6 --- /dev/null +++ b/files/templates/grassed.html @@ -0,0 +1,21 @@ +{% extends "settings2.html" %} + +{% block content %} + + + + + + + + +{% for user in users %} + + + + + +{% endfor %} +
#NameGrasser
{{loop.index}}{{user.username}}{{user.ban_reason.split('by ')[1]}}
+ +{% endblock %}