mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 05:26:45 +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):
|
if callable(validator):
|
||||||
# We can accept function validators with a single argument
|
# 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):
|
def validate_unique(self, exclude=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user