Simplified the get_object method in the AccountFormView in the accounting application.

This commit is contained in:
依瑪貓 2020-08-16 13:43:35 +08:00
parent b52733775c
commit 12a27ba01e

View File

@ -988,9 +988,7 @@ class AccountFormView(FormView):
def get_object(self) -> Optional[Account]:
"""Returns the current object, or None on a create form."""
if "account" in self.kwargs:
return self.kwargs["account"]
return None
return self.kwargs.get("account")
@require_POST