Skip to content

Commit

Permalink
Pridaná validácia, pri zakladaní semestra, či súťaž je naozaj semester
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Dec 13, 2024
1 parent de5a62f commit 8d1967d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions competition/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ 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)')
if attrs.get('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):
Expand Down

0 comments on commit 8d1967d

Please sign in to comment.