Fix bug, None was used instead of empty for DB outage (#14463)

This commit is contained in:
Alan Rominger
2023-09-21 14:30:25 -04:00
committed by GitHub
parent 3e607f8964
commit 29ad6e1eaa
2 changed files with 20 additions and 0 deletions

View File

@@ -418,6 +418,10 @@ class SettingsWrapper(UserSettingsHolder):
"""Get value while accepting the in-memory cache if key is available"""
with _ctit_db_wrapper(trans_safe=True):
return self._get_local(name)
# If the last line did not return, that means we hit a database error
# in that case, we should not have a local cache value
# thus, return empty as a signal to use the default
return empty
def __getattr__(self, name):
value = empty