Skip to content

Commit

Permalink
fixed mapping issue (#241)
Browse files Browse the repository at this point in the history
Co-authored-by: Ashutosh619-sudo <[email protected]>
  • Loading branch information
Ashutosh619-sudo and Ashutosh619-sudo authored Jul 11, 2023
1 parent d288cfd commit 47ecfae
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions apps/xero/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,14 @@ class DestinationAttributesView(generics.ListAPIView):
def get_queryset(self):
attribute_types = self.request.query_params.get('attribute_types').split(',')
active = self.request.query_params.get('active')
workspace_id = self.kwargs['workspace_id']

filters = {
'attribute_type__in': attribute_types,
'workspace_id': workspace_id
}

if active and active.lower() == 'true':
active = True
filters['active'] = True

return DestinationAttribute.objects.filter(
attribute_type__in=attribute_types, active=active, workspace_id=self.kwargs['workspace_id']).order_by('value')
return DestinationAttribute.objects.filter(**filters).order_by('value')

0 comments on commit 47ecfae

Please sign in to comment.