Compare commits

...

4 Commits

Author SHA1 Message Date
Mai 97f2af5a2b Merge branch 'patch-3' into 'master'
Channel names no longer end with a dash

See merge request litecord/litecord!70
2021-11-09 22:55:07 +00:00
Mai 549d5992fd Finally got things to work 2020-09-12 05:07:51 +00:00
Mai fbc15219f7 I am terrible at python jfc 2020-09-10 20:28:39 +00:00
Mai e9edd8ba37 Channel names are not supposed to end with a dash, pretty ghetto way of doing it but I'm tired af 2020-09-10 20:20:27 +00:00
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ def validate(
if reqjson is None:
raise BadRequest("No JSON provided")
try:
if schema["type"]["type"] == "channel_type" and reqjson["name"][-1] == "-":
reqjson["name"] = reqjson["name"][:-1]
except:
pass
try:
valid = validator.validate(reqjson)
except Exception: