From ed72de738cd2c1b5f0eef5b7951bcbfe478630e8 Mon Sep 17 00:00:00 2001 From: Wesley Bomar Date: Fri, 6 Aug 2021 12:56:41 -0500 Subject: [PATCH] GH-88: SystemSpecs: Fix Dup. Internal Link Opt Do not let "Internal Link" have duplicate options. --- taccsite_cms/contrib/taccsite_system_specs/TODO.md | 2 +- taccsite_cms/contrib/taccsite_system_specs/cms_plugins.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/taccsite_cms/contrib/taccsite_system_specs/TODO.md b/taccsite_cms/contrib/taccsite_system_specs/TODO.md index 203427d74..a5a876fda 100644 --- a/taccsite_cms/contrib/taccsite_system_specs/TODO.md +++ b/taccsite_cms/contrib/taccsite_system_specs/TODO.md @@ -15,7 +15,7 @@ ## Problems to Fix -- [ ] Prevent duplicate entires in "Internal Link". +- [x] Prevent duplicate entires in "Internal Link". - [ ] Add missing link feature to "Data List Item" plugin. → GH-75 - [ ] Find makeshift way to list dependency plugins i.e. taccsite_data_list. diff --git a/taccsite_cms/contrib/taccsite_system_specs/cms_plugins.py b/taccsite_cms/contrib/taccsite_system_specs/cms_plugins.py index 38066fbfe..392b5df75 100644 --- a/taccsite_cms/contrib/taccsite_system_specs/cms_plugins.py +++ b/taccsite_cms/contrib/taccsite_system_specs/cms_plugins.py @@ -1,7 +1,8 @@ -from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import gettext_lazy as _ +from djangocms_link.cms_plugins import LinkPlugin + from taccsite_cms.contrib.helpers import concat_classnames from taccsite_cms.contrib.taccsite_offset.cms_plugins import get_direction_classname @@ -10,7 +11,7 @@ from .models import TaccsiteSystemSpecs @plugin_pool.register_plugin -class TaccsiteSystemSpecsPlugin(CMSPluginBase): +class TaccsiteSystemSpecsPlugin(LinkPlugin): """ Components > "System Specs" Plugin """ @@ -18,6 +19,8 @@ class TaccsiteSystemSpecsPlugin(CMSPluginBase): model = TaccsiteSystemSpecs name = _('System Specs') render_template = 'system_specs.html' + def get_render_template(self, context, instance, placeholder): + return self.render_template cache = True text_enabled = False