def feed(request, group_slug): try: if group_slug == 'all': feedgen = TopicFeedAll(group_slug, request).get_feed() else: group = BaseGroup.objects.get(slug=group_slug) # concept of a RSS feed for a logged-in user is weird, but OK... if group.is_visible(request.user): feedgen = TopicFeedGroup(group_slug, request).get_feed(group_slug) else: return HttpResponseForbidden() except feeds.FeedDoesNotExist: raise Http404, _("Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not.") % slug response = HttpResponse(mimetype=feedgen.mime_type) feedgen.write(response, 'utf-8') return response
def all(request): feedgen = TopicFeedAll(None, request).get_feed() response = HttpResponse(mimetype=feedgen.mime_type) feedgen.write(response, 'utf-8') return response