Improve course field validation
This commit is contained in:
parent
8a8161c976
commit
2040875fe0
|
@ -255,14 +255,14 @@ class SessionListSerializer(SessionSerializer):
|
||||||
|
|
||||||
|
|
||||||
class CourseSerializer(serializers.ModelSerializer):
|
class CourseSerializer(serializers.ModelSerializer):
|
||||||
name = serializers.CharField()
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Course
|
model = models.Course
|
||||||
fields = ['id', 'name']
|
fields = ['id', 'name']
|
||||||
|
|
||||||
class CourseDetailSerializer(serializers.ModelSerializer):
|
class CourseDetailSerializer(serializers.ModelSerializer):
|
||||||
sessions = SessionListSerializer(many=True, read_only=True)
|
sessions = SessionListSerializer(many=True, read_only=True)
|
||||||
description = HTMLField()
|
name = serializers.CharField(max_length=100)
|
||||||
|
description = HTMLField(max_length=6000)
|
||||||
class Meta:
|
class Meta:
|
||||||
model = models.Course
|
model = models.Course
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
|
|
|
@ -44,7 +44,7 @@ function InstructorCourseEditor(props) {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Form.Field>
|
<Form.Field>
|
||||||
<label>Description</label>
|
<label>Description — {input.description ? input.description.length : 0}/6000</label>
|
||||||
<ReactQuill
|
<ReactQuill
|
||||||
value={input.description || ''}
|
value={input.description || ''}
|
||||||
modules={modules}
|
modules={modules}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user