diff --git a/apps/qbd/models.py b/apps/qbd/models.py index 4283a5d..b483fb1 100644 --- a/apps/qbd/models.py +++ b/apps/qbd/models.py @@ -2,6 +2,7 @@ from typing import List from django.db import models +from django.conf import settings from apps.fyle.models import Expense from apps.tasks.models import AccountingExport @@ -78,8 +79,8 @@ def get_expense_purpose(workspace_id: str, expense: Expense) -> str: 'purpose': '{0}'.format(expense.purpose) if expense.purpose else '', 'report_number': '{0}'.format(expense.claim_number), 'spent_on': '{0}'.format(expense.spent_at.date()) if expense.spent_at else '', - 'expense_link': '{0}/app/main/#/enterprise/view_expense/{1}?org_id={2}'.format( - fyle_credentials.cluster_domain, expense.expense_id, org_id + 'expense_link': '{0}/app/admin/#/view_expense/{1}/?org_id={2}'.format( + settings.FYLE_APP_URL, expense.expense_id, org_id ) } diff --git a/quickbooks_desktop_api/settings.py b/quickbooks_desktop_api/settings.py index 85e339e..000c721 100644 --- a/quickbooks_desktop_api/settings.py +++ b/quickbooks_desktop_api/settings.py @@ -268,6 +268,7 @@ FYLE_BASE_URL = os.environ.get('FYLE_BASE_URL') +FYLE_APP_URL = os.environ.get('FYLE_APP_URL') FYLE_TOKEN_URI = os.environ.get('FYLE_TOKEN_URI') FYLE_CLIENT_ID = os.environ.get('FYLE_CLIENT_ID') FYLE_CLIENT_SECRET = os.environ.get('FYLE_CLIENT_SECRET') diff --git a/quickbooks_desktop_api/tests/settings.py b/quickbooks_desktop_api/tests/settings.py index efab4e7..cb61452 100644 --- a/quickbooks_desktop_api/tests/settings.py +++ b/quickbooks_desktop_api/tests/settings.py @@ -242,6 +242,7 @@ FYLE_BASE_URL = os.environ.get('FYLE_BASE_URL') +FYLE_APP_URL = os.environ.get('FYLE_APP_URL') FYLE_TOKEN_URI = os.environ.get('FYLE_TOKEN_URI') FYLE_CLIENT_ID = os.environ.get('FYLE_CLIENT_ID') FYLE_CLIENT_SECRET = os.environ.get('FYLE_CLIENT_SECRET')