From 30676f2610c609219882282237cfd30b1f373962 Mon Sep 17 00:00:00 2001 From: kanhebei <59640496+kanhebei@users.noreply.github.com> Date: Mon, 26 Sep 2022 23:25:08 +0800 Subject: [PATCH] Update base.py on_form_prefill I think it is more reasonable to change the second parameter to model --- flask_admin/model/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_admin/model/base.py b/flask_admin/model/base.py index c92b1dc96..c418501ea 100755 --- a/flask_admin/model/base.py +++ b/flask_admin/model/base.py @@ -2162,7 +2162,7 @@ def edit_view(self): return redirect(self.get_save_return_url(model, is_created=False)) if request.method == 'GET' or form.errors: - self.on_form_prefill(form, id) + self.on_form_prefill(form, model) form_opts = FormOpts(widget_args=self.form_widget_args, form_rules=self._form_edit_rules)