From 2a0c5d70e02114edbd79099d8480351d3ac746cd Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 9 Dec 2023 20:10:30 +0100 Subject: [PATCH] Add readonly fields on competition serializer --- competition/serializers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/competition/serializers.py b/competition/serializers.py index 031ca1cd..42ffc784 100644 --- a/competition/serializers.py +++ b/competition/serializers.py @@ -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: