Skip to content

Commit

Permalink
Feat: Resolve issue of failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Dec 26, 2024
1 parent 002c7e7 commit d34df9f
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions fyle_accounting_mappings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,27 +424,22 @@ def bulk_create_or_update_destination_attributes(
)
)
else:
condition = (
(attribute['value'] and primary_key_map[attribute['destination_id']]['value'] and
attribute['value'].lower() != primary_key_map[attribute['destination_id']]['value'].lower()) or
('code' in attribute and attribute['code'] and
attribute['code'] != primary_key_map[attribute['destination_id']]['code'])
)
condition = (attribute['value'] and primary_key_map[attribute['destination_id']]['value']
and attribute['value'].lower() != primary_key_map[attribute['destination_id']]['value'].lower()) \
or ('code' in attribute and attribute['code'] and attribute['code'] != primary_key_map[attribute['destination_id']]['code'])

if attribute_disable_callback_path and is_import_to_fyle_enabled and condition:
attributes_to_disable[attribute['destination_id']] = {
'value': primary_key_map['destination_id']['value'],
'value': primary_key_map[attribute['destination_id']]['value'],
'updated_value': attribute['value'],
'code': primary_key_map['destination_id']['code'],
'code': primary_key_map[attribute['destination_id']]['value'],
'updated_code': attribute['code']
}

condition = (
(attribute['value'] != primary_key_map[attribute['destination_id']]['value'])
or ('detail' in attribute and attribute['detail'] != primary_key_map[attribute['destination_id']]['detail'])
or ('active' in attribute and attribute['active'] != primary_key_map[attribute['destination_id']]['active'])
or ('code' in attribute and attribute['code'] and
attribute['code'] != primary_key_map[attribute['destination_id']]['code'])
)
condition = (attribute['value'] != primary_key_map[attribute['destination_id']]['value']) \
or ('detail' in attribute and attribute['detail'] != primary_key_map[attribute['destination_id']]['detail']) \
or ('active' in attribute and attribute['active'] != primary_key_map[attribute['destination_id']]['active']) \
or ('code' in attribute and attribute['code'] and attribute['code'] != primary_key_map[attribute['destination_id']]['code']) \

if update and condition:
attributes_to_be_updated.append(
Expand Down

0 comments on commit d34df9f

Please sign in to comment.