From d56a530312a217b856f9e47282bba709b166c82d Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 15 Nov 2020 05:10:52 +0000 Subject: [PATCH] Add some limits to class cost and student count --- apiserver/apiserver/api/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apiserver/apiserver/api/serializers.py b/apiserver/apiserver/api/serializers.py index 77a629c..c3e8901 100644 --- a/apiserver/apiserver/api/serializers.py +++ b/apiserver/apiserver/api/serializers.py @@ -379,6 +379,8 @@ class SessionSerializer(serializers.ModelSerializer): datetime = serializers.DateTimeField() course = serializers.PrimaryKeyRelatedField(queryset=models.Course.objects.all()) students = TrainingSerializer(many=True, read_only=True) + max_students = serializers.IntegerField(min_value=1, max_value=50, allow_null=True) + cost = serializers.DecimalField(max_digits=None, decimal_places=2, min_value=0, max_value=200) class Meta: model = models.Session