From 5d4972d981d0429b4bd775de54f4e655c618080f Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 1 May 2022 19:46:17 +1000 Subject: [PATCH] Convert settings to 'native' values before running callable valiators --- InvenTree/common/models.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index f1cd8bc09a..84f9a4277d 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -455,7 +455,14 @@ class BaseInvenTreeSetting(models.Model): if callable(validator): # We can accept function validators with a single argument - validator(self.value) + + if self.is_bool(): + value = self.as_bool() + + if self.is_int(): + value = self.as_int() + + validator(value) def validate_unique(self, exclude=None, **kwargs): """