From ba00580fec3d990167077343e5b75bc6767ed481 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 26 Aug 2024 13:27:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20myschedule=20createserializer=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/system/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/system/serializers.py b/apps/system/serializers.py index eaddce82..0931a9c6 100755 --- a/apps/system/serializers.py +++ b/apps/system/serializers.py @@ -431,9 +431,9 @@ class MyScheduleCreateSerializer(CustomModelSerializer): def validate(self, attrs): if attrs['type'] == 10 and attrs.get('interval_', None): - pass + attrs.pop('crontab_') elif attrs['type'] == 20 and attrs.get('crontab_', None): - pass + attrs.pop('interval_') else: raise ValidationError('信息有误') return super().validate(attrs)