New web ui
This commit is contained in:
1 parent
a360fd9c63
commit
caee27c3ea
11 files changed
+248
-16
No files matched your search
+2
-2
@@ -96,8 +96,8 @@ def _extra_kittens(value: str) -> tuple[tuple[str, int, str], ...]:
|
||||
|
||||
def _validate_independence(skill: str, primary: str, extras: tuple[tuple[str, int, str], ...] | list[tuple[str, int, str]]) -> None:
|
||||
statuses = (primary,) + tuple(independence for _, _, independence in extras)
|
||||
if skill == "ЗУ" and len(set(statuses)) > 1:
|
||||
raise ValueError("Для ЗУ все котята в одном отчёте должны иметь одинаковый статус")
|
||||
if skill == "ЗУ" and any(s != "самостоятельно" for s in statuses):
|
||||
raise ValueError("Для ЗУ все котята должны быть самостоятельными")
|
||||
if skill == "ЛУ" and sum(status == "несамостоятельно" for status in statuses) > 1:
|
||||
raise ValueError("Для ЛУ допускается только один несамостоятельный котёнок")
|
||||
|
||||
|
||||
Reference in new issue
Block a user