From 9712a195f8e78ef2878b289f8503a918f39c09a5 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 5 Aug 2023 22:36:32 +0300 Subject: [PATCH] add url requirement to 8 badges --- files/routes/admin.py | 5 ++++- files/templates/admin/badge_admin.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 4e34405eb..7cc0bc108 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -490,7 +490,10 @@ def badge_grant_post(v): abort(403, "You can't grant this badge!") description = request.values.get("description") - url = request.values.get("url") + url = request.values.get("url", "").strip() + + if badge_id in {63,66,149,178,180,240,242,286,291,293} and not url: + abort(400, "This badge requires a url!") if url: if '\\' in url: abort(400) diff --git a/files/templates/admin/badge_admin.html b/files/templates/admin/badge_admin.html index 289f94e7c..dfd23e660 100644 --- a/files/templates/admin/badge_admin.html +++ b/files/templates/admin/badge_admin.html @@ -50,7 +50,7 @@ - + {% endif %}