Skip to content

Commit

Permalink
Use OSM_SERVER_URL variable name instead of OSM_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Oct 16, 2023
1 parent c0cfb19 commit 0641209
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down
6 changes: 3 additions & 3 deletions osmchadjango/changeset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 ""

Expand Down
2 changes: 1 addition & 1 deletion osmchadjango/changeset/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion osmchadjango/changeset/tests/test_comment_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 0641209

Please sign in to comment.