From 42efc344877397c0e7b772eabdaf01ba07addc66 Mon Sep 17 00:00:00 2001 From: ashwinthanaraj Date: Mon, 8 Feb 2021 17:52:06 +0530 Subject: [PATCH] BugFix: Update row on value changes --- fyle_accounting_mappings/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fyle_accounting_mappings/models.py b/fyle_accounting_mappings/models.py index 663a980..522c2ce 100644 --- a/fyle_accounting_mappings/models.py +++ b/fyle_accounting_mappings/models.py @@ -107,12 +107,12 @@ def bulk_upsert_destination_attributes(attributes: List[Dict], workspace_id): for attribute in attributes: destination_attribute, _ = DestinationAttribute.objects.update_or_create( attribute_type=attribute['attribute_type'], - value=attribute['value'], + destination_id=attribute['destination_id'], workspace_id=workspace_id, defaults={ 'active': attribute['active'] if 'active' in attribute else None, 'display_name': attribute['display_name'], - 'destination_id': attribute['destination_id'], + 'value': attribute['value'], 'detail': attribute['detail'] if 'detail' in attribute else None } )