diff --git a/apps/orgs/tasks.py b/apps/orgs/tasks.py index 5c83076..c270963 100644 --- a/apps/orgs/tasks.py +++ b/apps/orgs/tasks.py @@ -2,7 +2,7 @@ def async_update_fyle_credentials(fyle_org_id: str, refresh_token: str): - fyle_credentials = FyleCredential.objects.filter(workspace__org_id=fyle_org_id).first() + fyle_credentials = FyleCredential.objects.filter(org__fyle_org_id=fyle_org_id).first() if fyle_credentials: fyle_credentials.refresh_token = refresh_token fyle_credentials.save() diff --git a/apps/travelperk/actions.py b/apps/travelperk/actions.py index 524787c..db01737 100644 --- a/apps/travelperk/actions.py +++ b/apps/travelperk/actions.py @@ -231,8 +231,8 @@ def create_invoice_lineitems(org_id, invoice, expense, user_role, amount): if employee_email: assign_payload = { 'data': { - 'id': created_expense['data']['id'], - 'assignee_user_email': employee_email + 'id': created_expense['data']['id'], + 'assignee_user_email': employee_email } } @@ -269,7 +269,7 @@ def create_expense_against_employee(org_id, invoice, invoice_lineitems, user_rol expense = invoice_lineitems[0] # Create the expense against the employee with the total amount - created_expense = create_invoice_lineitems(org_id, expense, user_role, total_amount) + created_expense = create_invoice_lineitems(org_id, invoice, expense, user_role, total_amount) return created_expense