Skip to content

Commit

Permalink
Fix RSS item links (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel authored Mar 1, 2024
1 parent 6c6c36c commit 61a80e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion osmchadjango/supervise/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import xml.etree.ElementTree as ET

from django.urls import reverse
from django.conf import settings
from django.contrib.gis.geos import MultiPolygon, Polygon, Point, LineString, GEOSGeometry

from rest_framework.test import APITestCase
Expand Down Expand Up @@ -864,7 +865,11 @@ def test_aoi_changesets_feed_view(self):
items = [i for i in rss_data if i.tag == 'item']
link = [i for i in items[0] if i.tag == 'link'][0]
self.assertIn(
"https://osmcha.org?aoi=",
"{}/changesets/".format(settings.OSMCHA_URL),
link.text
)
self.assertIn(
"/?aoi=",
link.text
)
self.assertEqual(
Expand Down
2 changes: 1 addition & 1 deletion osmchadjango/supervise/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def item_geometry(self, item):
return item.bbox

def item_link(self, item):
return "{}{}".format(settings.OSMCHA_URL, "?aoi={}".format(self.feed_id))
return "{}/changesets/{}/?aoi={}".format(settings.OSMCHA_URL, item.id, self.feed_id)

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

0 comments on commit 61a80e8

Please sign in to comment.