fix bug of ranvher nmional code key in transaction
This commit is contained in:
@@ -123,6 +123,7 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
|||||||
items_data = self.context['request'].data['items']
|
items_data = self.context['request'].data['items']
|
||||||
with atomic():
|
with atomic():
|
||||||
# get rancher with national code
|
# get rancher with national code
|
||||||
|
if 'rancher_national_code' in validated_data.keys():
|
||||||
rancher = Rancher.objects.get(national_code=validated_data.pop('rancher_national_code'))
|
rancher = Rancher.objects.get(national_code=validated_data.pop('rancher_national_code'))
|
||||||
validated_data.update({'rancher': rancher})
|
validated_data.update({'rancher': rancher})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user