From 3f4a568d328faed7f050f1dd610c66bace41b7ad Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 8 Nov 2022 05:37:14 +0200 Subject: [PATCH] fix permachudding --- files/routes/admin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 8029bbc20..4fd3646d7 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1015,11 +1015,9 @@ def agendaposter(user_id, v): if reason and reason.startswith("/") and '\\' not in reason: reason = f'{reason}' - user.agendaposter = int(time.time()) + (days * 86400) - g.db.add(user) - duration = "permanently" if days: + user.agendaposter = int(time.time()) + (days * 86400) days_txt = str(days) if days_txt.endswith('.0'): days_txt = days_txt[:-2] duration = f"for {days_txt} day" @@ -1027,9 +1025,12 @@ def agendaposter(user_id, v): if reason: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days for the following reason:\n\n> {reason}" else: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days." else: + user.agendaposter = 1 if reason: text = f"@{v.username} (Admin) has chudded you permanently for the following reason:\n\n> {reason}" else: text = f"@{v.username} (Admin) has chudded you permanently." + g.db.add(user) + send_repeatable_notification(user.id, text) note = f'duration: {duration}'