add multiworld size limit to rolling endpoint
This commit is contained in:
parent
1afdd473ca
commit
2ee913f0ce
|
@ -59,6 +59,10 @@ def generate_api():
|
||||||
if json_data:
|
if json_data:
|
||||||
# example: options = {"player1weights" : {<weightsdata>}}
|
# example: options = {"player1weights" : {<weightsdata>}}
|
||||||
options = json_data["weights"]
|
options = json_data["weights"]
|
||||||
|
if len(options) > app.config["MAX_ROLL"]:
|
||||||
|
return {"text": "Max size of multiworld exceeded",
|
||||||
|
"detail": app.config["MAX_ROLL"]}, 409
|
||||||
|
|
||||||
race = bool(json_data["race"])
|
race = bool(json_data["race"])
|
||||||
results, gen_options = roll_yamls(options)
|
results, gen_options = roll_yamls(options)
|
||||||
if any(type(result) == str for result in results.values()):
|
if any(type(result) == str for result in results.values()):
|
||||||
|
|
Loading…
Reference in New Issue