From 2252e4cb98c6493833f5862fcef98702a8c9990f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Thu, 30 Jul 2020 07:35:30 +0800 Subject: [PATCH] Revised the code in the transaction_sotre() view in the accounting application. --- accounting/views.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/accounting/views.py b/accounting/views.py index 08c8277..0fff88b 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -851,11 +851,7 @@ def transaction_store(request, txn_type, transaction=None): fill_transaction_from_form(transaction, form) errors = {} try: - transaction.full_clean(exclude=[ - "sn", - "created_by", - "updated_by", - ]) + transaction.full_clean(exclude=["sn", "created_by", "updated_by"]) except ValidationError as e: errors = e.message_dict records = { @@ -868,11 +864,7 @@ def transaction_store(request, txn_type, transaction=None): no = no + 1 try: x.full_clean(exclude=[ - "sn", - "transaction", - "account", - "created_by", - "updated_by", + "sn", "transaction", "account", "created_by", "updated_by", ]) except ValidationError as e: for key in e.message_dict: