mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Convert settings to 'native' values before running callable valiators
This commit is contained in:
parent
3777686c92
commit
5d4972d981
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user