LU 1 nonsam

This commit is contained in:
nyan404 committed 2026-08-16 23:45:41 +03:00
1 parent ec5a1a197a
commit aa4c5f3681
5 files changed
+28 -25

No files matched your search

+6 -2
View File
@@ -73,8 +73,12 @@ class CoachingSession:
_positive_id(kitten_id, "ID дополнительного котёнка")
if independence not in ("самостоятельно", "несамостоятельно"):
raise ValueError("Некорректный статус самостоятельности")
if any(independence != self.kitten_independence for _, _, independence in self.extra_kittens):
raise ValueError("Все котята в одном отчёте должны быть либо самостоятельными, либо несамостоятельными")
statuses = (self.kitten_independence,) + tuple(independence for _, _, independence in self.extra_kittens)
nonself_count = sum(status == "несамостоятельно" for status in statuses)
if self.skill == "ЗУ" and len(set(statuses)) > 1:
raise ValueError("Для ЗУ все котята в одном отчёте должны иметь одинаковый статус")
if self.skill == "ЛУ" and nonself_count > 1:
raise ValueError("Для ЛУ допускается только один несамостоятельный котёнок")
@staticmethod
def duration_minutes(start: str, end: str) -> int: