fix: routepack serializer validate bug

This commit is contained in:
caoqianming 2024-07-08 08:25:45 +08:00
parent 56e40e6dd3
commit b18f39d95d
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ class RouteSerializer(CustomModelSerializer):
read_only_fields = EXCLUDE_FIELDS
def validate(self, attrs):
if 'routepack' in attrs:
if attrs.get('routepack', None):
attrs['material'] = attrs['routepack'].material
if 'mgroup' in attrs and attrs['mgroup']:
attrs['process'] = attrs['mgroup'].process