Improve course field validation
This commit is contained in:
parent
8a8161c976
commit
2040875fe0
|
@ -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__'
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in New Issue
Block a user