diff --git a/competition/serializers.py b/competition/serializers.py index 655d8f9e..ee2fd43b 100644 --- a/competition/serializers.py +++ b/competition/serializers.py @@ -60,7 +60,7 @@ class Meta: @ts_interface(context='competition') class CompetitionSerializer(serializers.ModelSerializer): - competition_type = CompetitionTypeSerializer(many=False) + competition_type = CompetitionTypeSerializer(many=False, read_only=True) upcoming_or_current_event = serializers.SerializerMethodField( 'get_upcoming_or_current') history_events = serializers.SerializerMethodField('get_history_events') diff --git a/competition/tests.py b/competition/tests.py index 023281ff..e3cbbdcd 100644 --- a/competition/tests.py +++ b/competition/tests.py @@ -337,7 +337,19 @@ def test_permission_get(self): def test_permission_update(self): ''' update permission OK''' self.check_permissions(self.URL_PREFIX + '/strom/', 'PUT', - self.ALL_FORBIDDEN, {'start_year': 2020}) + self.ONLY_STROM_OK_RESPONSES, + { + "id": 0, + "name": "STROM", + "slug": "strom", + "start_year": 1976, + "description": "popis", + "rules": "# Pravidlá", + "min_years_until_graduation": 0, + "sites": [ + 0 + ] + }) def test_permission_create(self): ''' create permission OK'''