Spaces:
Sleeping
Sleeping
Commit
•
56441c0
1
Parent(s):
f2fd77c
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import requests
|
|
3 |
import json
|
4 |
from numbers import Real
|
5 |
|
|
|
6 |
# Not meant to 100% validate a preset. Just enough that the code
|
7 |
# that renders it won't crash trying to access an invalid key.
|
8 |
class Validator:
|
@@ -49,7 +50,8 @@ class Validator:
|
|
49 |
], bool)
|
50 |
|
51 |
def validate_prompt_order(self):
|
52 |
-
self.
|
|
|
53 |
if self.validate_key("order", list):
|
54 |
if not Validator.is_valid_prompt_order_list(self.obj["order"]):
|
55 |
self.valid = False
|
|
|
3 |
import json
|
4 |
from numbers import Real
|
5 |
|
6 |
+
|
7 |
# Not meant to 100% validate a preset. Just enough that the code
|
8 |
# that renders it won't crash trying to access an invalid key.
|
9 |
class Validator:
|
|
|
50 |
], bool)
|
51 |
|
52 |
def validate_prompt_order(self):
|
53 |
+
if not self.try_validate_key("character_id", str):
|
54 |
+
self.validate_key("character_id", int)
|
55 |
if self.validate_key("order", list):
|
56 |
if not Validator.is_valid_prompt_order_list(self.obj["order"]):
|
57 |
self.valid = False
|