Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Making Unspecified always active #521

Merged
merged 6 commits into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/mappings/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,13 @@ def create_fyle_categories_payload(categories: List[DestinationAttribute], works
if updated_categories:
for category in updated_categories:
destination_id_of_category = category.mapping.first().destination.destination_id
payload.append({'id': category.source_id, 'name': category.value, 'code': destination_id_of_category, 'is_enabled': category.active})
payload.append({
'id': category.source_id,
'name': category.value,
'code': destination_id_of_category,
# Always keep Unspecified category enabled
'is_enabled': category.active if category.value != 'Unspecified' else True
})
else:
existing_category_names = ExpenseAttribute.objects.filter(attribute_type='CATEGORY', workspace_id=workspace_id).values_list('value', flat=True)

Expand Down
Loading