fix: align web reports with current rules
This commit is contained in:
1 parent
cffaaac755
commit
aecbb3bf6a
10 files changed
+47
-12
No files matched your search
@@ -230,6 +230,7 @@ class TrainingSession:
|
||||
escort_id: int
|
||||
kitten_name: str
|
||||
kitten_id: int
|
||||
date: str = ""
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""Валидирует данные сессии тренировки."""
|
||||
@@ -238,6 +239,8 @@ class TrainingSession:
|
||||
raise ValueError("Имена участников не могут быть пустыми")
|
||||
_positive_id(self.escort_id, "ID сопровождающего")
|
||||
_positive_id(self.kitten_id, "ID котёнка")
|
||||
if self.date:
|
||||
parse_report_date(self.date)
|
||||
if self.escort_id == self.kitten_id:
|
||||
raise ValueError("Сопровождающий и котёнок должны быть разными персонажами")
|
||||
|
||||
|
||||
Reference in new issue
Block a user