Aevann 2024-09-03 20:25:14 +03:00
parent e95b47c24f
commit 154e42b1e6
2 changed files with 2 additions and 3 deletions

View File

@ -23,9 +23,8 @@ def ping_groups(v):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def create_group(v):
name = request.values.get('name')
name = request.values.get("name", "").strip().lstrip("!").strip().lower()
if not name: stop(400)
name = name.strip().lower()
if name.startswith('slots') or name.startswith('remindme'):
stop(400, "You can't make a group with that name!")

View File

@ -9,7 +9,7 @@
<div class="body">
<input hidden name="formkey" value="{{v|formkey}}" class="notranslate" translate="no">
<label for="group-name">Group Name</label>
<input autocomplete="off" id="group-name" minlength="3" maxlength="25" pattern='[a-zA-Z0-9_\-]*' class="form-control" type="text" name="name" required>
<input autocomplete="off" id="group-name" minlength="3" maxlength="25" pattern='[!a-zA-Z0-9_\-]*' class="form-control" type="text" name="name" required>
<small class="form-text text-muted">3-25 characters, including letters, numbers, _ , and -</small>
<div class="footer">
<p class="text-danger mt-2">