add url requirement to 8 badges

master
Aevann 2023-08-05 22:36:32 +03:00
parent ed34558f33
commit 9712a195f8
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -50,7 +50,7 @@
<input autocomplete="off" id="input-url" class="form-control" type="text" name="url" type="url" placeholder="Optional">
<label class="mt-2" for="input-description">Custom description</label>
<input autocomplete="off" id="input-description" class="form-control" type="text" name="description" placeholder="Optional">
<input autocomplete="off" id="input-description" class="form-control" type="text" name="description" placeholder="Optional except for specific badges">
{% endif %}
<input autocomplete="off" class="btn btn-primary mt-3" type="submit">