From 760c7398648e12215689c06b8b30a16c52b2afdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 28 Jul 2020 00:23:13 +0800 Subject: [PATCH] Removed the transaction type from the template variables of the transactions, because they are not necessary at all 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, 3 insertions(+), 5 deletions(-) diff --git a/accounting/templates/accounting/transactions/expense/show.html b/accounting/templates/accounting/transactions/expense/show.html index bbee76c..e2eb52c 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 ae9102c..d43cd38 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 c5fdace..e22cf49 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 6c4c3c3..67dd6b4 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -856,7 +856,6 @@ def transaction_show(request, type, transaction): HttpResponse: The response. """ return render(request, F"accounting/transactions/{type}/show.html", { - "transaction_type": type, "item": transaction, }) @@ -879,6 +878,5 @@ def transaction_create(request, type): if len(transaction.credit_records) == 0: transaction.records.append(Record(ord=1, is_credit=True)) return render(request, F"accounting/transactions/{type}/edit.html", { - "transaction_type": type, "item": transaction, })