From c2065e7dc162c885042f21a09700f87a11b916d0 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Mon, 16 Sep 2024 14:06:50 +0200 Subject: [PATCH] Add uuid for as form settings id --- djangocms_text/widgets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/djangocms_text/widgets.py b/djangocms_text/widgets.py index 0cdec314..f4ee9c7b 100644 --- a/djangocms_text/widgets.py +++ b/djangocms_text/widgets.py @@ -1,4 +1,5 @@ import json +import uuid from copy import deepcopy from itertools import groupby from typing import Union @@ -68,7 +69,7 @@ def __init__( if self.editor_class not in attrs.get("class", "").join(" "): new_class = f'{attrs.get("class", "")} {self.editor_class}' attrs["class"] = new_class.strip() - self.editor_settings_id = f"cms-cfg-{pk if pk else attrs.get('id')}" + self.editor_settings_id = f"cms-cfg-{pk if pk else attrs.get('id', uuid.uuid4())}" attrs["data-settings"] = self.editor_settings_id super().__init__(attrs)