From c532e7cb0b058116f0bfd5cd13a18129972cfb2e Mon Sep 17 00:00:00 2001 From: Thomas NOEL Date: Fri, 29 May 2015 16:02:37 +0200 Subject: [PATCH] wcs, category cell: remove the possibility to link to internal pages (#7421) --- .../0009_remove_wcscategorycell_link_page.py | 18 ++++++++++++++++++ combo/apps/wcs/models.py | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py diff --git a/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py b/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py new file mode 100644 index 00000000..b5062fa9 --- /dev/null +++ b/combo/apps/wcs/migrations/0009_remove_wcscategorycell_link_page.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('wcs', '0008_wcsformcell_cached_json'), + ] + + operations = [ + migrations.RemoveField( + model_name='wcscategorycell', + name='link_page', + ), + ] diff --git a/combo/apps/wcs/models.py b/combo/apps/wcs/models.py index 97983c06..c4a3e2eb 100644 --- a/combo/apps/wcs/models.py +++ b/combo/apps/wcs/models.py @@ -110,7 +110,6 @@ class WcsCommonCategoryCell(CellBase): @register_cell_class class WcsCategoryCell(WcsCommonCategoryCell): - link_page = models.ForeignKey('data.Page', related_name='link', null=True) class Meta: verbose_name = _('Category Link') @@ -124,10 +123,7 @@ class WcsCategoryCell(WcsCommonCategoryCell): context['slug'] = self.category_reference.split(':')[-1] context['title'] = self.cached_title context['description'] = self.cached_description - if self.link_page: - context['url'] = self.link_page.get_online_url() - else: - context['url'] = self.cached_url + context['url'] = self.cached_url return category_template.render(context)