Skip to content

Commit

Permalink
Handle onboarding phase token expiry and add report_id to expense_gro…
Browse files Browse the repository at this point in the history
…ups/ response (#528)

* Handle onboarding phase token expiry

* add report_id to expense group response
  • Loading branch information
ashwin1111 authored Dec 19, 2023
1 parent a19590f commit fb9d62e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/fyle/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExpenseSerializer(serializers.ModelSerializer):

class Meta:
model = Expense
fields = ['updated_at', 'claim_number', 'employee_email', 'employee_name', 'fund_source', 'expense_number', 'payment_number', 'vendor', 'category', 'amount']
fields = ['updated_at', 'claim_number', 'employee_email', 'employee_name', 'fund_source', 'expense_number', 'payment_number', 'vendor', 'category', 'amount', 'report_id']


class ExpenseGroupSerializer(serializers.ModelSerializer):
Expand Down
4 changes: 2 additions & 2 deletions apps/workspaces/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def get(self, request, **kwargs):
"""
Get QBO Credentials in Workspace
"""
qbo_credentials = QBOCredential.objects.get(workspace=kwargs['workspace_id'], is_expired=False)
qbo_credentials = QBOCredential.objects.get(workspace=kwargs['workspace_id'])

return Response(data=QBOCredentialSerializer(qbo_credentials).data, status=status.HTTP_200_OK if qbo_credentials.refresh_token else status.HTTP_400_BAD_REQUEST)
return Response(data=QBOCredentialSerializer(qbo_credentials).data, status=status.HTTP_200_OK if qbo_credentials.refresh_token and not qbo_credentials.is_expired else status.HTTP_400_BAD_REQUEST)


class GeneralSettingsView(generics.RetrieveAPIView):
Expand Down

0 comments on commit fb9d62e

Please sign in to comment.