qualiupdate bug
This commit is contained in:
parent
c5070eee2e
commit
bad4e27c0d
|
|
@ -126,11 +126,11 @@ class QActionQualiCreateSerializer(serializers.ModelSerializer):
|
|||
if validated_data['value2']['type'] in ['CMA', 'CNAS']:
|
||||
validated_data['value2']['name'] = validated_data['value2']['type']
|
||||
value2 = validated_data['value2']
|
||||
if value2['province']:
|
||||
if value2.get('province', None):
|
||||
value2['province'] = value2['province'].id
|
||||
if value2['city']:
|
||||
if value2.get('city', None):
|
||||
value2['city'] = value2['city'].id
|
||||
if value2['file']:
|
||||
if value2.get('file', None):
|
||||
value2['file'] = value2['file'].id
|
||||
return super().create(validated_data)
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ class QActionQualiUpdateSerializer(serializers.ModelSerializer):
|
|||
def create(self, validated_data):
|
||||
validated_data['action'] = 'quali:update'
|
||||
value2 = validated_data['value2']
|
||||
if value2['file']:
|
||||
if value2.get('file', None):
|
||||
value2['file'] = value2['file'].id
|
||||
return super().create(validated_data)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue