backport bugfixes from 0.3.6
This commit is contained in:
parent
9c3755637a
commit
d9690ea3a5
2 changed files with 13 additions and 4 deletions
|
|
@ -4,6 +4,14 @@
|
|||
|
||||
+ Added `ValueProperty`, abstract superclass for `ConfigProperty`.
|
||||
|
||||
## 0.3.6
|
||||
|
||||
- Fixed `ConfigValue` behavior with multiple sources. It used to iterate through all the sources, possibly overwriting; now, iteration stops at first non-missing value.
|
||||
|
||||
## 0.3.5
|
||||
|
||||
- Fixed cb32 handling. Now leading zeros in SIQ's are stripped, and `.from_cb32()` was implemented.
|
||||
|
||||
## 0.3.4
|
||||
|
||||
- Bug fixes in `.flask_restx` regarding error handling
|
||||
|
|
|
|||
|
|
@ -170,10 +170,11 @@ class ValueProperty(Generic[_T]):
|
|||
if srckey != 'default':
|
||||
logger.info(f'value {self._name} found in {srckey} source')
|
||||
break
|
||||
if self._required and (not v or v is MISSING):
|
||||
raise self._not_found(f'required config {self._srcs['default']} not set!')
|
||||
if v is MISSING:
|
||||
v = self._default
|
||||
if not _not_missing(v):
|
||||
if self._required:
|
||||
raise self._not_found(f'required config {self._srcs['default']} not set!')
|
||||
else:
|
||||
v = self._default
|
||||
if callable(self._cast):
|
||||
v = self._cast(v) if v is not None else self._cast()
|
||||
self._val = v
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue