Commit a152fbc2 authored by Conner Mo's avatar Conner Mo

on_form_prefill() should be executed when form validation fail.

parent 2f14840c
...@@ -1989,7 +1989,7 @@ class BaseModelView(BaseView, ActionsMixin): ...@@ -1989,7 +1989,7 @@ class BaseModelView(BaseView, ActionsMixin):
# save button # save button
return redirect(self.get_save_return_url(model, is_created=False)) return redirect(self.get_save_return_url(model, is_created=False))
if request.method == 'GET': if request.method == 'GET' or form.errors:
self.on_form_prefill(form, id) self.on_form_prefill(form, id)
form_opts = FormOpts(widget_args=self.form_widget_args, form_opts = FormOpts(widget_args=self.form_widget_args,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment