Revised the documentation in FormView in the Mia core application.

This commit is contained in:
依瑪貓 2020-08-16 19:10:38 +08:00
parent eba94c2b96
commit b829002c61

View File

@ -147,12 +147,12 @@ class FormView(View):
setattr(obj, name, form[name].value())
def form_invalid(self, form: forms.Form) -> HttpResponseRedirect:
"""Handles the action when the POST form is invalid"""
"""Handles the action when the POST form is invalid."""
return stored_post.error_redirect(
self.request, self.get_error_url(), form.data)
def form_valid(self, form: forms.Form) -> HttpResponseRedirect:
"""Handles the action when the POST form is valid"""
"""Handles the action when the POST form is valid."""
obj = self.get_object()
if obj is None:
obj = self._model()