feat: myschedule createserializer 优化
This commit is contained in:
parent
6205ba682c
commit
ba00580fec
|
@ -431,9 +431,9 @@ class MyScheduleCreateSerializer(CustomModelSerializer):
|
||||||
|
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
if attrs['type'] == 10 and attrs.get('interval_', None):
|
if attrs['type'] == 10 and attrs.get('interval_', None):
|
||||||
pass
|
attrs.pop('crontab_')
|
||||||
elif attrs['type'] == 20 and attrs.get('crontab_', None):
|
elif attrs['type'] == 20 and attrs.get('crontab_', None):
|
||||||
pass
|
attrs.pop('interval_')
|
||||||
else:
|
else:
|
||||||
raise ValidationError('信息有误')
|
raise ValidationError('信息有误')
|
||||||
return super().validate(attrs)
|
return super().validate(attrs)
|
||||||
|
|
Loading…
Reference in New Issue