Skip to content

Commit

Permalink
- Fix for issue Map Composer Menu not show complete #3804
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 15, 2018
1 parent dbde966 commit 07ebfee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
1 change: 0 additions & 1 deletion geonode/client/templates/geoext/geo_header.html
Expand Up @@ -34,7 +34,6 @@
OpenLayers.Util.onImageLoadError = function() {
this.src = '{{ STATIC_URL }}geonode/img/light_gray.jpg';
};
Ext.BLANK_IMAGE_URL = "{{ STATIC_URL }}geonode/img/light_gray.jpg";

OpenLayers.Request.DEFAULT_CONFIG.headers = {
'X-CSRFToken': '{{ csrf_token|escapejs }}'
Expand Down
36 changes: 21 additions & 15 deletions geonode/geoserver/helpers.py
Expand Up @@ -1187,25 +1187,31 @@ def get_store(cat, name, workspace=None):

if workspace is None:
workspace = cat.get_default_workspace()
try:
store = cat.get_xml('%s/%s.xml' % (workspace.datastore_url[:-4], name))
except FailedRequestError:

if workspace:
try:
store = cat.get_xml('%s/%s.xml' % (workspace.coveragestore_url[:-4], name))
store = cat.get_xml('%s/%s.xml' % (workspace.datastore_url[:-4], name))
except FailedRequestError:
try:
store = cat.get_xml('%s/%s.xml' % (workspace.wmsstore_url[:-4], name))
store = cat.get_xml('%s/%s.xml' % (workspace.coveragestore_url[:-4], name))
except FailedRequestError:
raise FailedRequestError("No store found named: " + name)

if store.tag == 'dataStore':
store = datastore_from_index(cat, workspace, store)
elif store.tag == 'coverageStore':
store = coveragestore_from_index(cat, workspace, store)
elif store.tag == 'wmsStore':
store = wmsstore_from_index(cat, workspace, store)

return store
try:
store = cat.get_xml('%s/%s.xml' % (workspace.wmsstore_url[:-4], name))
except FailedRequestError:
raise FailedRequestError("No store found named: " + name)
if store:
if store.tag == 'dataStore':
store = datastore_from_index(cat, workspace, store)
elif store.tag == 'coverageStore':
store = coveragestore_from_index(cat, workspace, store)
elif store.tag == 'wmsStore':
store = wmsstore_from_index(cat, workspace, store)

return store
else:
raise FailedRequestError("No store found named: " + name)
else:
raise FailedRequestError("No store found named: " + name)


class ServerDoesNotExist(Exception):
Expand Down

0 comments on commit 07ebfee

Please sign in to comment.