Skip to content

Commit

Permalink
Fixing file path when workspace name has / in it (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shwetabhk authored Jan 24, 2024
1 parent cb6b432 commit 9fdf952
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/qbd/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create_bills_iif_file(workspace_id: int, accounting_export: AccountingExport

workspace_name = accounting_export.workspace.name

file_path = os.path.join('/tmp', '{}-{}-bills-{}.iif'.format(workspace_name, accounting_export.id, datetime.now().strftime('%Y-%m-%d')))
file_path = os.path.join('/tmp', '{}-{}-bills-{}.iif'.format(workspace_name.replace('/', ''), accounting_export.id, datetime.now().strftime('%Y-%m-%d')))

expenses = Expense.objects.filter(
workspace_id=workspace_id,
Expand Down Expand Up @@ -111,7 +111,7 @@ def create_credit_card_purchases_iif_file(workspace_id: int, accounting_export:

workspace_name = accounting_export.workspace.name

file_path = os.path.join('/tmp', '{}-{}-credit-card-purchases-{}.iif'.format(workspace_name, accounting_export.id, datetime.now().strftime('%Y-%m-%d')))
file_path = os.path.join('/tmp', '{}-{}-credit-card-purchases-{}.iif'.format(workspace_name.replace('/', ''), accounting_export.id, datetime.now().strftime('%Y-%m-%d')))

expenses = Expense.objects.filter(
workspace_id=workspace_id,
Expand Down Expand Up @@ -177,7 +177,7 @@ def create_journals_iif_file(workspace_id: int, accounting_export: AccountingExp

workspace_name = accounting_export.workspace.name

file_path = os.path.join('/tmp', '{}-{}-journals-{}.iif'.format(workspace_name, accounting_export.id, datetime.now().strftime('%Y-%m-%d')))
file_path = os.path.join('/tmp', '{}-{}-journals-{}.iif'.format(workspace_name.replace('/', ''), accounting_export.id, datetime.now().strftime('%Y-%m-%d')))

expenses = Expense.objects.filter(
workspace_id=workspace_id,
Expand Down

0 comments on commit 9fdf952

Please sign in to comment.