From de539ab7e5b833e0d48dfe8510a0600e57c09077 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 30 May 2022 05:30:32 +0200 Subject: [PATCH] fixed a bug that caused 500 errors when jannies left the input area for days empty when they chudded someone also removed some useless code for checking admin status on alts (why did I add this) --- files/routes/admin.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index ce92eb64ea..673461ce60 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -932,18 +932,16 @@ def admin_removed_comments(v): def agendaposter(user_id, v): user = g.db.query(User).filter_by(id=user_id).one_or_none() - days = min(float(request.values.get("days", 30.0)), 30.0) + days = request.values.get("days") + if not days: days = 30.0 + days = float(days) + days = min(days, 30.0) expiry = int(time.time() + days*60*60*24) user.agendaposter = expiry g.db.add(user) - for alt in user.alts: - if alt.admin_level: return {"error": "User is an admin!"} - alt.agendaposter = expiry - g.db.add(alt) - note = f"for {days} days" ma = ModAction(