Skip to content

Commit

Permalink
[Fixes #6916] gsimporter.api.NotFound caused by missing trailing slas…
Browse files Browse the repository at this point in the history
…h at the end of GEOSERVER_LOCATION (#6913)

* [Fixes #6916] gsimporter.api.NotFound caused by missing trailing slash at the end of GEOSERVER_LOCATION

* [Fixes #6916] unit test for GEOSERVER_LOCATION
  • Loading branch information
malnajdi committed Feb 3, 2021
1 parent 7c6b4b3 commit e7cea19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,10 @@
'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/'
)

# add trailing slash to geoserver location url.
if not GEOSERVER_LOCATION.endswith('/'):
GEOSERVER_LOCATION = '{}/'.format(GEOSERVER_LOCATION)

GEOSERVER_PUBLIC_SCHEMA = os.getenv(
'GEOSERVER_PUBLIC_SCHEMA', SITE_HOST_SCHEMA
)
Expand Down
6 changes: 6 additions & 0 deletions geonode/tests/smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def test_opensearch_description(self):
response = self.client.get(reverse('opensearch_dispatch'))
self.assertEqual(response.status_code, 200)

# Settings Tests #

def test_settings_geoserver_location(self):
'''Ensure GEOSERVER_LOCATION variable ends with /'''
self.assertTrue(settings.GEOSERVER_LOCATION.endswith('/'))


class GeoNodeUtilsTests(GeoNodeBaseTestSupport):

Expand Down

0 comments on commit e7cea19

Please sign in to comment.