Skip to content

Commit

Permalink
Refactor Config class to ignore non-editable variables managed by spe…
Browse files Browse the repository at this point in the history
…cific methods
  • Loading branch information
TheophileDiot committed Oct 24, 2024
1 parent 8cf6035 commit 6e43766
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/app/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ def check_variables(
elif setting not in config and plugins_settings[setting]["default"] == v:
variables.pop(k)
continue
elif not new and setting != "IS_DRAFT" and setting in config and config[setting]["method"] not in ("default", "ui"):
elif (
not new
and setting != "IS_DRAFT"
and setting in config
and ((global_config or not config[setting]["global"]) and config[setting]["method"] not in ("default", "ui"))
):
message = f"Variable {k} is not editable as is it managed by the {config[setting]['method']}, ignoring it"
if threaded:
self.__data["TO_FLASH"].append({"content": message, "type": "error"})
Expand Down

0 comments on commit 6e43766

Please sign in to comment.