From b3b6a0edadecc28e126b9ca4687be3baf92ddea2 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 13 Apr 2024 23:14:22 +0200 Subject: [PATCH] Add verbose name for semester --- competition/serializers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/competition/serializers.py b/competition/serializers.py index 8e9d643..65b2256 100644 --- a/competition/serializers.py +++ b/competition/serializers.py @@ -361,6 +361,7 @@ class SemesterWithProblemsSerializer(ModelWithParticipationSerializer): ) publication_set = PublicationSerializer(many=True, read_only=True) complete = serializers.SerializerMethodField('get_complete') + verbose_name = serializers.SerializerMethodField('get_verbose_name') class Meta: model = models.Semester @@ -384,6 +385,9 @@ def create(self, validated_data: dict): semester.late_tags.add(tag) return semester + def get_verbose_name(self, obj): + return str(obj) + @ts_interface(context='competition') class LateTagSerializer(serializers.ModelSerializer):