Skip to content

Commit

Permalink
Merge pull request #316 from ZdruzenieSTROM/readonly_competition_fields
Browse files Browse the repository at this point in the history
Add readonly fields on competition serializer
  • Loading branch information
mmihalik authored Dec 9, 2023
2 parents 44ce1e7 + 2a0c5d7 commit dd6fe48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions competition/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ class CompetitionSerializer(serializers.ModelSerializer):
class Meta:
model = models.Competition
exclude = ['permission_group']
read_only_fields = [
'upcoming_or_current_event',
'history_events',
'competition_type',
'name',
'slug',
'start_year',
'min_years_until_graduation',
'sites'
]

def get_upcoming_or_current(self, obj):
try:
Expand Down

0 comments on commit dd6fe48

Please sign in to comment.