diff --git a/config/settings/common.py b/config/settings/common.py index c629ea58..6aa95334 100644 --- a/config/settings/common.py +++ b/config/settings/common.py @@ -358,7 +358,7 @@ CACHALOT_ENABLED = True # OSM SERVER SETTINGS -OSM_URL = env('OSM_SERVER_URL', default='https://www.openstreetmap.org') +OSM_SERVER_URL = env('OSM_SERVER_URL', default='https://www.openstreetmap.org') OSM_PLANET_BASE_URL = env( 'OSM_PLANET_BASE_URL', default='https://planet.openstreetmap.org/replication/changesets/' diff --git a/osmchadjango/changeset/models.py b/osmchadjango/changeset/models.py index d0a96636..272aa194 100644 --- a/osmchadjango/changeset/models.py +++ b/osmchadjango/changeset/models.py @@ -99,13 +99,13 @@ def save(self, *args, **kwargs): def osm_link(self): """Return the link to the changeset page on OSM website.""" - return '{}/changeset/{}'.format(settings.OSM_URL, self.id) + return '{}/changeset/{}'.format(settings.OSM_SERVER_URL, self.id) def josm_link(self): """Return link to open changeset in JOSM.""" josm_base = "http://127.0.0.1:8111/import?url=" changeset_url = "{}/api/0.6/changeset/{}/download".format( - settings.OSM_URL, + settings.OSM_SERVER_URL, self.id, ) return "{}{}".format(josm_base, changeset_url) @@ -114,7 +114,7 @@ def id_link(self): """Return link to open the area of the changeset in iD editor.""" if self.bbox: centroid = [round(c, 5) for c in self.bbox.centroid.coords] - return "{}/edit?editor=id#map=16/{}/{}".format(settings.OSM_URL, centroid[1], centroid[0]) + return "{}/edit?editor=id#map=16/{}/{}".format(settings.OSM_SERVER_URL, centroid[1], centroid[0]) else: return "" diff --git a/osmchadjango/changeset/tasks.py b/osmchadjango/changeset/tasks.py index 5b7d2ee9..29d237e4 100644 --- a/osmchadjango/changeset/tasks.py +++ b/osmchadjango/changeset/tasks.py @@ -113,7 +113,7 @@ def __init__(self, user, changeset_id): resource_owner_secret=user_token['oauth_token_secret'] ) self.url = '{}/api/0.6/changeset/{}/comment/'.format( - settings.OSM_URL, + settings.OSM_SERVER_URL, changeset_id ) diff --git a/osmchadjango/changeset/tests/test_comment_views.py b/osmchadjango/changeset/tests/test_comment_views.py index 543911ea..a08f40f0 100644 --- a/osmchadjango/changeset/tests/test_comment_views.py +++ b/osmchadjango/changeset/tests/test_comment_views.py @@ -74,7 +74,7 @@ class MockResponse(): mock_oauth_client.assert_called_with( 'POST', '{}/api/0.6/changeset/{}/comment/'.format( - settings.OSM_URL, + settings.OSM_SERVER_URL, self.harmful_changeset.id ), data='text={}'.format(quote(message)).encode('utf-8'),