fix: mlog create 不带mtask时报错

This commit is contained in:
caoqianming 2023-10-31 13:33:40 +08:00
parent c376cfb24a
commit 27e4022d9a
1 changed files with 9 additions and 8 deletions

View File

@ -122,7 +122,8 @@ class MlogSerializer(CustomModelSerializer):
return super().update(instance, validated_data)
def validate(self, attrs):
mtask = attrs['mtask']
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