Skip to content

Commit

Permalink
fix implementation of aoi param on rss links
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Sep 24, 2019
1 parent 36b5ff3 commit c3d86d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion osmchadjango/supervise/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def test_aoi_changesets_feed_view(self):
rss_data = ET.fromstring(response.content).getchildren()[0].getchildren()
title = [i for i in rss_data if i.tag == 'title'][0]
items = [i for i in rss_data if i.tag == 'item']
link = [i for i in rss_data if i.tag == 'link']
link = [i for i in items[0].getchildren() if i.tag == 'link'][0]
self.assertIn(
"?aoi=",
link.text
Expand Down
6 changes: 5 additions & 1 deletion osmchadjango/supervise/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class AOIListChangesetsFeedView(Feed):
"""

def get_object(self, request, pk):
self.feed_id = pk
return AreaOfInterest.objects.get(pk=pk)

def title(self, obj):
Expand All @@ -138,7 +139,10 @@ def item_geometry(self, item):
return item.bbox

def item_link(self, item):
return reverse('frontend:changeset-detail', args=[item.id], kwargs={'aoi':obj.id})
return '{}{}'.format(reverse(
'frontend:changeset-detail',
args=[item.id]
), '?aoi={}'.format(self.feed_id))

def item_pubdate(self, item):
return item.date
Expand Down

0 comments on commit c3d86d8

Please sign in to comment.