Skip to content

Commit

Permalink
Point to new app for failed/skipped/queued ones (#566)
Browse files Browse the repository at this point in the history
* Point to new app for failed/skipped/queued ones

* fix test
  • Loading branch information
ashwin1111 authored Feb 14, 2024
1 parent eb97f93 commit eeee57e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions apps/fyle/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def update_expenses_in_progress(in_progress_expenses: List[Expense]) -> None:
expense.expense_id,
'IN_PROGRESS',
None,
'{}/workspaces/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
'{}/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
False
)
)
Expand Down Expand Up @@ -149,7 +149,7 @@ def mark_expenses_as_skipped(final_query: Q, expenses_object_ids: List, workspac
expense.expense_id,
'SKIPPED',
None,
'{}/workspaces/main/export_log'.format(settings.QBO_INTEGRATION_APP_URL),
'{}/main/export_log'.format(settings.QBO_INTEGRATION_APP_URL),
False
)
)
Expand Down Expand Up @@ -199,7 +199,7 @@ def update_failed_expenses(failed_expenses: List[Expense], is_mapping_error: boo
expense.expense_id,
'ERROR',
error_type,
'{}/workspaces/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
'{}/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
False
)
)
Expand Down Expand Up @@ -268,7 +268,7 @@ def __handle_post_accounting_export_summary_exception(exception: Exception, work
expense_instance.expense_id,
'DELETED',
None,
'{}/workspaces/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
'{}/main/dashboard'.format(settings.QBO_INTEGRATION_APP_URL),
True
)
)
Expand Down
2 changes: 1 addition & 1 deletion apps/workspaces/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def run_email_notification(workspace_id):
'qbo_company': qbo.company_name,
'export_time': export_time.strftime("%d %b %Y | %H:%M"),
'year': date.today().year,
'app_url': "{0}/workspaces/main/dashboard".format(settings.FYLE_APP_URL),
'app_url': "{0}/main/dashboard".format(settings.QBO_INTEGRATION_APP_URL),
'task_logs': mark_safe(expense_html),
'error_type': expense_data,
}
Expand Down
1 change: 0 additions & 1 deletion fyle_qbo_api/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
FYLE_CLIENT_ID = os.environ.get('FYLE_CLIENT_ID')
FYLE_CLIENT_SECRET = os.environ.get('FYLE_CLIENT_SECRET')
FYLE_BASE_URL = os.environ.get('FYLE_BASE_URL')
FYLE_APP_URL = os.environ.get('APP_URL')
FYLE_EXPENSE_URL = os.environ.get('FYLE_APP_URL')

QBO_INTEGRATION_APP_URL = os.environ.get('QBO_INTEGRATION_APP_URL')
Expand Down
8 changes: 4 additions & 4 deletions tests/test_fyle/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_update_expenses_in_progress(db):
for expense in expenses:
assert expense.accounting_export_summary['synced'] == False
assert expense.accounting_export_summary['state'] == 'IN_PROGRESS'
assert expense.accounting_export_summary['url'] == '{}/workspaces/main/dashboard'.format(
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(
settings.QBO_INTEGRATION_APP_URL
)
assert expense.accounting_export_summary['error_type'] == None
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_mark_accounting_export_summary_as_synced(db):
'tx_123',
'SKIPPED',
None,
'{}/workspaces/main/export_log'.format(settings.QBO_INTEGRATION_APP_URL),
'{}/main/export_log'.format(settings.QBO_INTEGRATION_APP_URL),
True
)
expense.save()
Expand All @@ -82,7 +82,7 @@ def test_update_failed_expenses(db):
assert expense.accounting_export_summary['synced'] == False
assert expense.accounting_export_summary['state'] == 'ERROR'
assert expense.accounting_export_summary['error_type'] == 'MAPPING'
assert expense.accounting_export_summary['url'] == '{}/workspaces/main/dashboard'.format(
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(
settings.QBO_INTEGRATION_APP_URL
)
assert expense.accounting_export_summary['id'] == expense.expense_id
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_handle_post_accounting_export_summary_exception(db):
assert expense.accounting_export_summary['synced'] == True
assert expense.accounting_export_summary['state'] == 'DELETED'
assert expense.accounting_export_summary['error_type'] == None
assert expense.accounting_export_summary['url'] == '{}/workspaces/main/dashboard'.format(
assert expense.accounting_export_summary['url'] == '{}/main/dashboard'.format(
settings.QBO_INTEGRATION_APP_URL
)
assert expense.accounting_export_summary['id'] == expense_id

0 comments on commit eeee57e

Please sign in to comment.