Skip to content

Commit

Permalink
RSS object returns press if no journal.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajrbyers committed Aug 2, 2017
1 parent be1cb0d commit 3ee43fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/rss/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@


class LatestNewsFeed(Feed):
title = "Journal News"
title = "News"
link = "/news/"
description = "Updates on changes and additions to police beat central."

def get_object(self, request, *args, **kwargs):
return request.journal

return request.journal if request.journal else request.press

def items(self, obj):
content_type = ContentType.objects.get_for_model(obj)
Expand All @@ -46,8 +47,8 @@ def item_link(self, item):


class LatestArticlesFeed(Feed):
title = "Journal Articles"
link = "/news/"
title = "Articles"
link = "/articles/"
description = "Updates on changes and additions to police beat central."

def get_object(self, request, *args, **kwargs):
Expand Down

0 comments on commit 3ee43fa

Please sign in to comment.