Skip to content

Commit dcc0a21

Browse files
committed
fix: weird config.get() bug w/ default values
1 parent 80dfced commit dcc0a21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/config_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ def get(self, attribute_name, default=None, is_json=False, user=None, tags=None)
269269

270270
if not is_json and value is not None:
271271
value = json.loads(value)
272-
# TODO: check this as it feels like it could cause a default to return even if value is not None. - Dale
273-
elif default is not None:
274-
value = default
272+
# TODO: Which default should have priority? The provided default feels like it should be the highest priority, but I think that is an old implementation and perhaps should be removed. - Dale
275273
elif value is None and setting_name in self.config_definition and "default" in self.config_definition[setting_name]:
276274
value = self.config_definition[setting_name]["default"]
275+
elif value is None and default is not None:
276+
value = default
277277

278278
final_settings[setting_name] = value
279279

0 commit comments

Comments
 (0)