2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-01 13:06:45 +00:00

Convert settings to 'native' values before running callable valiators

This commit is contained in:
Oliver Walters 2022-05-01 19:46:17 +10:00
parent 3777686c92
commit 5d4972d981

View File

@ -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):
"""