From 3da1fd8a1ff1356fdf1c07f03bf30021ff81b002 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Sun, 27 Oct 2024 23:59:01 +0100 Subject: [PATCH] Set correct default for empty link --- djangocms_link/fields.py | 1 + 1 file changed, 1 insertion(+) diff --git a/djangocms_link/fields.py b/djangocms_link/fields.py index 373cf372..519e9494 100644 --- a/djangocms_link/fields.py +++ b/djangocms_link/fields.py @@ -250,6 +250,7 @@ class LinkFormField(Field): def __init__(self, *args, **kwargs): kwargs.setdefault("help_text", _("Select a link type and provide a link.")) + kwargs.setdefault("initial", {}) kwargs.pop("encoder", None) # Passed from LinkField's JSONField parent class kwargs.pop("decoder", None) # but not needed super().__init__(*args, **kwargs)