Removed automatic interpretation of contentlets as templates as per issue #168.
[philo.git] / philo / templatetags / containers.py
index e280e60..be94a3d 100644 (file)
@@ -48,19 +48,9 @@ class ContainerNode(template.Node):
                        # Otherwise it's a contentlet.
                        try:
                                contentlet = page.contentlets.get(name__exact=self.name)
-                               if '{%' in contentlet.content or '{{' in contentlet.content:
-                                       try:
-                                               content = template.Template(contentlet.content, name=contentlet.name).render(context)
-                                       except template.TemplateSyntaxError, error:
-                                               if settings.DEBUG:
-                                                       content = ('[Error parsing contentlet \'%s\': %s]' % (self.name, error))
-                                               else:
-                                                       content = settings.TEMPLATE_STRING_IF_INVALID
-                               else:
-                                       content = contentlet.content
+                               content = contentlet.content
                        except ObjectDoesNotExist:
-                               content = settings.TEMPLATE_STRING_IF_INVALID
-                       content = mark_safe(content)
+                               content = ''
                return content
 
 
@@ -87,7 +77,7 @@ def container(parser, token):
                                if option_token == 'references':
                                        try:
                                                app_label, model = remaining_tokens.pop(0).strip('"').split('.')
-                                               references = ContentType.objects.get(app_label=app_label, model=model)
+                                               references = ContentType.objects.get_by_natural_key(app_label, model)
                                        except IndexError:
                                                raise template.TemplateSyntaxError('"%s" template tag option "references" requires an argument specifying a content type' % tag)
                                        except ValueError: