Skip to content

Commit

Permalink
fix: weird config.get() bug w/ default values
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Oct 31, 2024
1 parent 80dfced commit dcc0a21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ def get(self, attribute_name, default=None, is_json=False, user=None, tags=None)

if not is_json and value is not None:
value = json.loads(value)
# TODO: check this as it feels like it could cause a default to return even if value is not None. - Dale
elif default is not None:
value = default
# 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
elif value is None and setting_name in self.config_definition and "default" in self.config_definition[setting_name]:
value = self.config_definition[setting_name]["default"]
elif value is None and default is not None:
value = default

final_settings[setting_name] = value

Expand Down

0 comments on commit dcc0a21

Please sign in to comment.