From 31c1c7c35ac1c4d04f95e40c1e908e35d4c9a3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 18 Aug 2020 10:02:53 +0800 Subject: [PATCH] Removed the unnecessary setting the current usr in the TransactionFormView and AccountFormView in the accounting application. --- accounting/views.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/accounting/views.py b/accounting/views.py index 1519bb2..60d4e10 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -837,7 +837,6 @@ class TransactionFormView(FormView): """Fills in the data model from the form.""" obj.old_date = obj.date utils.fill_txn_from_post(self.txn_type, obj, form.data) - obj.current_user = self.request.user def get_object(self) -> Optional[Account]: """Returns the current object, or None on a create form.""" @@ -954,12 +953,6 @@ class AccountFormView(FormView): form.account = obj return form - def fill_model_from_form(self, obj: Account, form: AccountForm) -> None: - """Fills in the data model from the form.""" - obj.code = form["code"].value() - obj.title = form["title"].value() - obj.current_user = self.request.user - def get_object(self) -> Optional[Account]: """Returns the current object, or None on a create form.""" return self.kwargs.get("account")