Skip to content

Commit

Permalink
enable cloning in SimpleEditMode
Browse files Browse the repository at this point in the history
A requested clone action has to be set as _new=True.
However in the _get_render_settings() a new entry was hard reset to a new default entry and ignoring a possible cloned entry.

Change-Id: I23cc0024d11cf2991ef9678774bb4674f709407c
  • Loading branch information
otAAAh committed Feb 7, 2025
1 parent bcf908a commit 8867ff0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmk/gui/wato/pages/_simple_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ def _from_vars(self, ident_var: str = "ident") -> None:
)

self._new = True
self._clone = self._default_id()
self._ident = None
self._entry = self._clone_entry(entry)
return
Expand Down Expand Up @@ -801,10 +802,13 @@ def _get_render_settings(self) -> tuple[Any, DataOrigin, DoValidate]:
True,
)

if self._new:
if self._new and not self._clone:
# New form, no validation
return DEFAULT_VALUE, DataOrigin.DISK, False

if self._clone:
self._ident = self._clone

# Existing entry from disk
catalog_converter = self._get_catalog_converter()

Expand Down

0 comments on commit 8867ff0

Please sign in to comment.