diff --git a/djangocms_link/models.py b/djangocms_link/models.py index e49270b7..f6900d33 100644 --- a/djangocms_link/models.py +++ b/djangocms_link/models.py @@ -71,7 +71,6 @@ class AbstractLink(CMSPlugin): link = LinkField( verbose_name=_('Link'), - blank=False, ) # advanced options target = models.CharField( @@ -120,6 +119,10 @@ def clean(self): code='required', ) + def __init__(self, *args, **wkargs): + super().__init__(*args, **wkargs) + self._meta.get_field('link').blank = self.link_is_optional + class Link(AbstractLink): class Meta: