fix(applications): reject boolean numeric input
This commit is contained in:
1 parent
093e0f6f73
commit
947cebc256
3 files changed
+12
No files matched your search
@@ -29,6 +29,8 @@ class ApplicationError(ValueError):
|
||||
|
||||
|
||||
def _positive_id(value: Any, label: str) -> int:
|
||||
if isinstance(value, bool):
|
||||
raise ApplicationError(f"{label} должно быть числом")
|
||||
try:
|
||||
result = int(value)
|
||||
except (TypeError, ValueError) as exc:
|
||||
|
||||
Reference in new issue
Block a user