Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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