From 6182ef3c58f1bdfb25ef2b1c0f45457c2d3ecc7e Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 18 Dec 2023 11:20:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mlog=E6=8F=90=E4=BA=A4=E6=97=B6?= =?UTF-8?q?=E5=A6=82=E6=9C=89mtask=E5=88=99handle=5Fdate=E4=B8=BAmtask?= =?UTF-8?q?=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wpm/serializers.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/wpm/serializers.py b/apps/wpm/serializers.py index 8332a2ae..e9b41de1 100644 --- a/apps/wpm/serializers.py +++ b/apps/wpm/serializers.py @@ -279,11 +279,7 @@ class MlogSerializer(CustomModelSerializer): def validate(self, attrs): mtask = attrs.get('mtask', None) if mtask: - handle_date = attrs['handle_date'] - if handle_date >= mtask.start_date and handle_date <= mtask.end_date: - pass - else: - raise ValidationError('操作日期错误') + attrs['handle_date'] = mtask.start_date if mtask.state != Mtask.MTASK_ASSGINED: raise ValidationError(f'{mtask.mgroup.name}_不可提交日志!') return attrs