Simplified the get_object method in the UserFormView in the Mia core application.

This commit is contained in:
依瑪貓 2020-08-16 13:44:41 +08:00
parent 12a27ba01e
commit 499b7897ef

View File

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