X-Git-Url: http://git.ithinksw.org/philo.git/blobdiff_plain/2f7b3e87ff28392c872a0e828224d0b781297041..ac4596780e153ed1d9e46c98a2179eaeed7b034e:/contrib/penfield/models.py?ds=inline diff --git a/contrib/penfield/models.py b/contrib/penfield/models.py index 98dcdd5..b970643 100644 --- a/contrib/penfield/models.py +++ b/contrib/penfield/models.py @@ -10,6 +10,8 @@ from django.utils.datastructures import SortedDict from django.utils.encoding import smart_unicode, force_unicode from django.utils.html import escape from datetime import date, datetime +from philo.contrib.penfield.exceptions import HttpNotAcceptable +from philo.contrib.penfield.middleware import http_not_acceptable from philo.contrib.penfield.validators import validate_pagination_count from philo.exceptions import ViewCanNotProvideSubpath from philo.models import Tag, Titled, Entity, MultiView, Page, register_value_model, TemplateField, Template @@ -62,7 +64,7 @@ class FeedView(MultiView): urlpatterns = patterns('') if self.feeds_enabled: feed_reverse_name = "%s_feed" % reverse_name - feed_view = self.feed_view(get_items_attr, feed_reverse_name) + feed_view = http_not_acceptable(self.feed_view(get_items_attr, feed_reverse_name)) feed_pattern = r'%s%s%s$' % (base, (base and base[-1] != "^") and "/" or "", self.feed_suffix) urlpatterns += patterns('', url(feed_pattern, feed_view, name=feed_reverse_name), @@ -139,8 +141,7 @@ class FeedView(MultiView): else: feed_type = None if not feed_type: - # See RFC 2616 - return HttpResponse(status=406) + raise HttpNotAcceptable return FEEDS[feed_type] def get_feed(self, obj, request, reverse_name):