Add some limits to class cost and student count
This commit is contained in:
parent
e69a65ae0b
commit
d56a530312
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user