Revised the fill_model_from_form() method in the FormView in the Mia core application.
This commit is contained in:
parent
7d364da930
commit
95b6a6a4ea
@ -151,8 +151,8 @@ class FormView(View):
|
|||||||
|
|
||||||
def fill_model_from_form(self, obj: Model, form: forms.Form) -> None:
|
def fill_model_from_form(self, obj: Model, form: forms.Form) -> None:
|
||||||
"""Fills in the data model from the form."""
|
"""Fills in the data model from the form."""
|
||||||
for name in form.data.keys():
|
for name in form.fields:
|
||||||
setattr(obj, name, form.data[name])
|
setattr(obj, name, form[name].value())
|
||||||
|
|
||||||
def get_error_url(self) -> str:
|
def get_error_url(self) -> str:
|
||||||
"""Returns the URL on error."""
|
"""Returns the URL on error."""
|
||||||
|
Loading…
Reference in New Issue
Block a user