backport bugfixes from 0.3.6

This commit is contained in:
Yusur 2025-07-09 17:15:42 +02:00
parent 9c3755637a
commit d9690ea3a5
2 changed files with 13 additions and 4 deletions

View file

@ -4,6 +4,14 @@
+ Added `ValueProperty`, abstract superclass for `ConfigProperty`. + 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 ## 0.3.4
- Bug fixes in `.flask_restx` regarding error handling - Bug fixes in `.flask_restx` regarding error handling

View file

@ -170,9 +170,10 @@ class ValueProperty(Generic[_T]):
if srckey != 'default': if srckey != 'default':
logger.info(f'value {self._name} found in {srckey} source') logger.info(f'value {self._name} found in {srckey} source')
break break
if self._required and (not v or v is MISSING): if not _not_missing(v):
if self._required:
raise self._not_found(f'required config {self._srcs['default']} not set!') raise self._not_found(f'required config {self._srcs['default']} not set!')
if v is MISSING: else:
v = self._default v = self._default
if callable(self._cast): if callable(self._cast):
v = self._cast(v) if v is not None else self._cast() v = self._cast(v) if v is not None else self._cast()