diff --git a/contracts/models.py b/contracts/models.py index 01790457415e185c1506f9430e1cd029c570878d..6e4a7a5bb4cfb2050d709be4e6eada49fef2c843 100644 --- a/contracts/models.py +++ b/contracts/models.py @@ -746,6 +746,22 @@ class Contract(NameStrMixin, models.Model): } ) + if ( + self.paper_form_state not in ( + self.PaperFormStates.STORED, + self.PaperFormStates.SHREDDED, + self.PaperFormStates.LOST + ) + and not self.paper_form_person_responsible + ): + raise ValidationError( + { + "paper_form_person_responsible": ( + "Musí být vyplněno, pokud smlouva není uložená / skartovaná / ztracená." + ) + } + ) + if ( self.valid_start_date and self.valid_end_date