fix bug of rancher nations code key in transaction
This commit is contained in:
@@ -122,7 +122,10 @@ class InventoryQuotaSaleTransactionSerializer(serializers.ModelSerializer):
|
||||
|
||||
def create(self, validated_data):
|
||||
items_data = self.context['request'].data['items']
|
||||
rancher_code = validated_data.pop('rancher_national_code')
|
||||
rancher_code = validated_data.pop(
|
||||
'rancher_national_code'
|
||||
) if 'rancher_national_code' in self.context['request'].data.keys() else None
|
||||
|
||||
with atomic():
|
||||
# get rancher with national code
|
||||
rancher = None
|
||||
|
||||
Reference in New Issue
Block a user