Changeset - 835d482604b3
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 7 years ago 2014-07-14 18:39:10
bkuhn@ebb.org
No longer "stash" the GET object in self.

I don't think this was actually necessary ultimately. I think the older
code, herein removed, in item_author_email() was wrong-headed in the
first place, or at the very least, was overkill.

Each item has a distinct author, according to the BlogEntry model. So,
I think this is actually what we want. I noticed the author filed isn't
properly going into the RSS at the moment anyway, but I'm somewhat past
caring about that, as long as the URLs now work to get author- and tag-
specific feeds.
1 file changed with 2 insertions and 21 deletions:
0 comments (0 inline, 0 general)
www/conservancy/feeds.py
Show inline comments
...
 
@@ -154,9 +154,6 @@ class BlogFeed(ConservancyFeedBase):
 
    get_absolute_url = '/feeds/blog/'
 

	
 
    def get_object(self, request):
 
        # This is a hack:  keep GET object handy so I always have it in all methods.
 
        if not hasattr(self, 'GET') and request and hasattr(request, 'GET'):
 
            self.GET = request.GET
 
        return request
 

	
 
    def title(self, obj):
...
 
@@ -226,29 +223,13 @@ class BlogFeed(ConservancyFeedBase):
 
        return item.author.formal_name
 

	
 
    def item_author_email(self, item):
 
        GET = self.GET
 
        if not 'author' in GET:
 
            return "%s@sfconservancy.org" % item.author
 
        else:
 
            answer = ""
 
            authors = GET.getlist('author')
 
            firstTime = True
 
            for author in authors:
 
                if not firstTime:
 
                    answer = "%s@sfconservancy.org" % author
 
                    firstTime = False
 
                else:
 
                    answer += ",%s@sfconservancy.org" % author
 
        return "%s@sfconservancy.org" % item.author
 

	
 
    def item_pubdate(self, item):
 
        return item.pub_date
 

	
 
    def items(self, obj):
 
        # This is a hack:  keep GET object handy so I always have it in all methods.
 
        if not hasattr(self, 'GET') and request and hasattr(request, 'GET'):
 
            self.GET = request.GET
 

	
 
        GET = self.GET
 
        GET = obj.GET
 

	
 
        def OR_filter(field_name, subfield_name, objs):
 
            from django.db.models import Q
0 comments (0 inline, 0 general)