add tests
This commit is contained in:
@ -161,7 +161,7 @@ class _Value:
|
||||
fullpath,
|
||||
withwarning)
|
||||
else:
|
||||
value = self.config.get_value(key, schema)
|
||||
value = self.config.get_value(key)
|
||||
self._display_warnings(key, value, option['type'], option['name'], withwarning)
|
||||
ret[key] = value
|
||||
|
||||
@ -235,7 +235,7 @@ class TiramisuOptionValue(_Value):
|
||||
self.index = index
|
||||
|
||||
def get(self) -> Any:
|
||||
value = self.config.get_value(self.path, self.schema)
|
||||
value = self.config.get_value(self.path)
|
||||
self._display_warnings(self.path, value, self.schema['type'], self.schema['name'])
|
||||
return value
|
||||
|
||||
@ -601,13 +601,12 @@ class Config:
|
||||
return value
|
||||
|
||||
def get_value(self,
|
||||
path: str,
|
||||
schema: Dict) -> Any:
|
||||
path: str) -> Any:
|
||||
if 'value' in self.temp.get(path, {}):
|
||||
value = self.temp[path]['value']
|
||||
else:
|
||||
value = self.model.get(path, {}).get('value')
|
||||
if value is None and schema.get('isMulti', False):
|
||||
if value is None and self.get_schema(path).get('isMulti', False):
|
||||
value = []
|
||||
return value
|
||||
|
||||
@ -752,7 +751,7 @@ class Config:
|
||||
opts.append(path)
|
||||
for path_ in self.form[path]['not_equal']['options']:
|
||||
schema = self.get_schema(path_)
|
||||
p_value = self.get_value(path_, schema)
|
||||
p_value = self.get_value(path_)
|
||||
if isinstance(p_value, list):
|
||||
for val in p_value:
|
||||
vals.append(val)
|
||||
|
Reference in New Issue
Block a user