Commit df833e95 authored by Serge S. Koval's avatar Serge S. Koval Committed by GitHub

Merge pull request #1368 from connermo/fix/on_form_prefill

on_form_prefill() should be executed when form validation fail.
parents bf56541a a152fbc2
......@@ -1989,7 +1989,7 @@ class BaseModelView(BaseView, ActionsMixin):
# save button
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)
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