diff --git a/competition/serializers.py b/competition/serializers.py index c90ce14..1cf07c3 100644 --- a/competition/serializers.py +++ b/competition/serializers.py @@ -399,6 +399,9 @@ def validate(self, attrs): if attrs.get('season_code', 0) not in (0, 1): raise ValidationError( 'Seminár musí byť zimný alebo letný(season_code 0 alebo 1)') + competition: models.Competition | None = attrs.get('competition') + if competition and competition.competition_type.name != "Seminár": + raise ValidationError('Súťaž nie je typu seminár') return super().validate(attrs) def get_complete(self, obj: models.Semester):