From 20369e42cc02c3a75228068817b89122dd8df7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 23 Jul 2020 23:35:43 +0800 Subject: [PATCH] Fixed so that the URL in the transaction views uses the current transaction type specified in the URL rather than the type of the transaction itself in the accounting application. --- accounting/templates/accounting/transactions/expense/show.html | 2 +- accounting/templates/accounting/transactions/income/show.html | 2 +- accounting/templates/accounting/transactions/transfer/show.html | 2 +- accounting/views.py | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/accounting/templates/accounting/transactions/expense/show.html b/accounting/templates/accounting/transactions/expense/show.html index 8e0e27a..7078714 100644 --- a/accounting/templates/accounting/transactions/expense/show.html +++ b/accounting/templates/accounting/transactions/expense/show.html @@ -71,7 +71,7 @@ First written: 2020/7/23 {% trans "Back" context "Navigation|" as text %}{{ text|force_escape }} - + {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} diff --git a/accounting/templates/accounting/transactions/income/show.html b/accounting/templates/accounting/transactions/income/show.html index ab982ce..7728b9b 100644 --- a/accounting/templates/accounting/transactions/income/show.html +++ b/accounting/templates/accounting/transactions/income/show.html @@ -71,7 +71,7 @@ First written: 2020/7/23 {% trans "Back" context "Navigation|" as text %}{{ text|force_escape }} - + {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} diff --git a/accounting/templates/accounting/transactions/transfer/show.html b/accounting/templates/accounting/transactions/transfer/show.html index 968746e..41cd1ee 100644 --- a/accounting/templates/accounting/transactions/transfer/show.html +++ b/accounting/templates/accounting/transactions/transfer/show.html @@ -71,7 +71,7 @@ First written: 2020/7/23 {% trans "Back" context "Navigation|" as text %}{{ text|force_escape }} - + {% trans "Edit" context "Navigation|" as text %}{{ text|force_escape }} diff --git a/accounting/views.py b/accounting/views.py index 596f9aa..91fd9db 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -855,6 +855,8 @@ def transaction_show(request, type, transaction): Returns: HttpResponse: The response. """ + print(dir(request)) return render(request, F"accounting/transactions/{type}/show.html", { + "transaction_type": type, "item": transaction, })