Skip to content

Commit

Permalink
Fix stats for active flag (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwin1111 authored Mar 20, 2024
1 parent 30f63c1 commit adecfb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions fyle_accounting_mappings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ def get(self, request, *args, **kwargs):
'workspace_id': self.kwargs['workspace_id']
}

if ((source_type == 'PROJECT' and destination_type == 'CUSTOMER') or\
(source_type == 'CATEGORY')):
if source_type in ('PROJECT', 'CATEGORY'):
filters['active'] = True

total_attributes_count = ExpenseAttribute.objects.filter(**filters).count()
Expand Down Expand Up @@ -239,8 +238,7 @@ def get(self, request, *args, **kwargs):
'destination_type' : destination_type,
'workspace_id': self.kwargs['workspace_id']
}
if ((source_type == 'PROJECT' and destination_type == 'CUSTOMER') or\
(source_type == 'CATEGORY')):
if source_type in ('PROJECT', 'CATEGORY'):
filters['source__active'] = True

mapped_attributes_count = Mapping.objects.filter(**filters).count()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setuptools.setup(
name='fyle-accounting-mappings',
version='1.31.4',
version='1.31.5',
author='Shwetabh Kumar',
author_email='[email protected]',
description='Django application to store the fyle accounting mappings in a generic manner',
Expand Down

0 comments on commit adecfb7

Please sign in to comment.