Skip to content

Commit

Permalink
remove legacy code
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Oct 28, 2024
1 parent 35a874e commit 9ef96d6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
19 changes: 0 additions & 19 deletions djangocms_link/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool

from .forms import LinkForm
from .helpers import get_link
from .models import Link


class LinkPlugin(CMSPluginBase):
model = Link
form = LinkForm
name = _('Link')
text_enabled = True
allow_children = True
Expand Down Expand Up @@ -40,22 +38,5 @@ def render(self, context, instance, placeholder):
context['link'] = get_link(instance.link, getattr(get_current_site(context["request"]), "id", None))
return super().render(context, instance, placeholder)

def get_form(self, request, obj=None, **kwargs):
form_class = super().get_form(request, obj, **kwargs)

if obj and obj.page and hasattr(obj.page, 'site') and obj.page.site:
site = obj.page.site
elif self.page and hasattr(self.page, 'site') and self.page.site:
site = self.page.site
else:
site = get_current_site(request)

class Form(form_class):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.for_site(site)

return Form


plugin_pool.register_plugin(LinkPlugin)
37 changes: 0 additions & 37 deletions djangocms_link/forms.py

This file was deleted.

0 comments on commit 9ef96d6

Please sign in to comment.