Skip to content

Commit

Permalink
Basic work to make it django-1.4 compatible (django.contrib.syndicati…
Browse files Browse the repository at this point in the history
…on.views.feed was removed). Some bugs remains (HTML seems to

be escaped where it shouldn't), but at least it doesn't fail completely.
  • Loading branch information
diox committed Oct 31, 2011
1 parent f0137ae commit 001579e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion notification/atomformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Feed(object):
VALIDATE = True


def __init__(self, slug, feed_url):
def __init__(self, slug=None, feed_url=None):
# @@@ slug and feed_url are not used yet
pass

Expand Down
12 changes: 5 additions & 7 deletions notification/views.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from django.core.urlresolvers import reverse
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, Http404
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.template import RequestContext

from django.contrib.auth.decorators import login_required
from django.contrib.syndication.views import feed

from notification.models import *
from notification.decorators import basic_auth_required, simple_basic_auth_callback
Expand All @@ -16,11 +15,10 @@ def feed_for_user(request):
"""
An atom feed for all unarchived :model:`notification.Notice`s for a user.
"""
url = "feed/%s" % request.user.username
return feed(request, url, {
"feed": NoticeUserFeed,
})

feedgen = NoticeUserFeed().get_feed(request.user.username)
response = HttpResponse(mimetype=feedgen.mime_type)
feedgen.write(response, 'utf-8')
return response

@login_required
def notices(request):
Expand Down

0 comments on commit 001579e

Please sign in to comment.