Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verbose name for semester #374

Merged
merged 1 commit into from
Apr 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions competition/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
Loading