From 11b603f998829a14c0e62094b65ebc7145edf503 Mon Sep 17 00:00:00 2001 From: kovacspe Date: Sat, 13 Apr 2024 23:17:46 +0200 Subject: [PATCH] Add verbose name for semester (#374) --- competition/serializers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/competition/serializers.py b/competition/serializers.py index 1c40ee1..d224acb 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):