From d43e42246da089f1507860c9b93281aec8a7eb69 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Mon, 11 Dec 2023 00:13:25 -0800 Subject: [PATCH] store id before checking custom validation --- py4web/utils/form.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py4web/utils/form.py b/py4web/utils/form.py index 1abe81515..5b1e84458 100644 --- a/py4web/utils/form.py +++ b/py4web/utils/form.py @@ -821,10 +821,10 @@ def __init__( self.record and self.record.get(field_name) or None ) self.vars.update(validated_vars) - if validation: - validation(self) if self.record and dbio: self.vars["id"] = self.record.id + if validation: + validation(self) if not self.errors: for file in uploaded_files: field, value = file