diff --git a/contracts/models.py b/contracts/models.py index 8dccd010af8591b328ebb378774ace725f8a8262..4fcc486fe7a928177203f5b7e6534391af910f95 100644 --- a/contracts/models.py +++ b/contracts/models.py @@ -607,13 +607,13 @@ class Contract(NameStrMixin, models.Model): {"cost_amount": "Nemůže být definováno bez jednoty nákladů."} ) - if self.cost_unit == self.CostUnits.OTHER[1] and not self.cost_unit_other: + if self.cost_unit == self.CostUnits.OTHER and not self.cost_unit_other: raise ValidationError( { "cost_unit_other": "Musí být definováno, pokud je vybrána jednotka nákladů 'jiné'." } ) - elif self.cost_unit != self.CostUnits.OTHER[1] and self.cost_unit_other: + elif self.cost_unit != self.CostUnits.OTHER and self.cost_unit_other: raise ValidationError( { "cost_unit_other": "Nemůže být definováno, pokud není vybrána jednotka nákladů 'jiné'."