Skip to content

Commit

Permalink
Add uuid for as form settings id
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Sep 16, 2024
1 parent 2137744 commit c2065e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion djangocms_text/widgets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import uuid
from copy import deepcopy
from itertools import groupby
from typing import Union
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c2065e7

Please sign in to comment.