Improve course field validation

This commit is contained in:
Tanner Collin 2020-01-15 08:03:25 +00:00
parent 8a8161c976
commit 2040875fe0
2 changed files with 3 additions and 3 deletions

View File

@ -255,14 +255,14 @@ class SessionListSerializer(SessionSerializer):
class CourseSerializer(serializers.ModelSerializer):
name = serializers.CharField()
class Meta:
model = models.Course
fields = ['id', 'name']
class CourseDetailSerializer(serializers.ModelSerializer):
sessions = SessionListSerializer(many=True, read_only=True)
description = HTMLField()
name = serializers.CharField(max_length=100)
description = HTMLField(max_length=6000)
class Meta:
model = models.Course
fields = '__all__'

View File

@ -44,7 +44,7 @@ function InstructorCourseEditor(props) {
/>
<Form.Field>
<label>Description</label>
<label>Description {input.description ? input.description.length : 0}/6000</label>
<ReactQuill
value={input.description || ''}
modules={modules}