-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic settings: there is no way to return None, False, 0, empty string #68
Comments
I suggest that _dynamic_reader should raise AttributeError if attr not found. Then
|
make sense, how do you think about handle this behavior (raise AttributeError) on dynamic_settings backends (e.g. Redis)? |
to begin we can check if if self._dynamic_reader:
dynamic_result = self._dynamic_reader.get(attr)
if dynamic_result is not None: # <---
self._dict[attr] = dynamic_result
result = dynamic_result This change fix issues with |
python redis client has a different behavior for cases when key was not found and when key has None value:
so we can raise AttributeError when redis returned None and return None when redis returned b'None' |
Anyway, check for None value ( |
Great, I'll work on it! |
Thank you @unknownlighter for your feedback, I'll release a hotfix soon. |
Great. Thank you @drgarcia1986 for fast response and fix |
This code does not allow to return from dynamic_reader value that doesn't meet the condition
if self._dynamic_reader:
such asNone
,False
,0
,''
The text was updated successfully, but these errors were encountered: