From f17bce610daa417de331594122220dce4a6c76f8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 21 Sep 2022 22:55:34 +0200 Subject: [PATCH 1/3] make chud award generate a mod log item when used by JL3 --- files/routes/awards.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/routes/awards.py b/files/routes/awards.py index 348b59931..c5bf4cd7b 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -288,6 +288,15 @@ def award_thing(v, thing_type, id): else: author.agendaposter = int(time.time()) + 86400 badge_grant(user=author, badge_id=28) + + if v.admin_level > 2: + ma = ModAction( + kind="agendaposter", + user_id=v.id, + target_user_id=author.id, + note=f"for 1 day" + ) + g.db.add(ma) elif kind == "flairlock": if thing.ghost: abort(403) new_name = note[:100].replace("𒐪","") From 201208e673a45368cc5c1b84cc20b97403f2c601 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Sep 2022 00:28:35 +0200 Subject: [PATCH 2/3] make deflector not stack --- files/routes/awards.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index c5bf4cd7b..eaec855ee 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -366,8 +366,7 @@ def award_thing(v, thing_type, id): else: author.rehab = int(time.time()) + 86400 badge_grant(user=author, badge_id=109) elif kind == "deflector": - if author.deflector: author.deflector += 36000 - else: author.deflector = int(time.time()) + 36000 + author.deflector = int(time.time()) + 36000 elif kind == "beano": badge_grant(user=author, badge_id=128) elif kind == "checkmark": From 955cee3f83140a6daa1465d99d7725fbfb640e5c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 22 Sep 2022 00:28:58 +0200 Subject: [PATCH 3/3] revise award immunity --- files/routes/awards.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index eaec855ee..f5ddefca9 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -166,7 +166,7 @@ def award_thing(v, thing_type, id): author = thing.author - if author.id in (PIZZASHILL_ID, DAD_ID, CARP_ID) and v.id not in (PIZZASHILL_ID, DAD_ID, CARP_ID): + if author.id in (PIZZASHILL_ID, CARP_ID): return {"error": "This user is immune to awards."}, 403 if kind == "benefactor" and author.id == v.id: