fix: routepack serializer validate bug
This commit is contained in:
parent
56e40e6dd3
commit
b18f39d95d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue