Skip to content

Commit

Permalink
Merge pull request GeoNode#171 from Coop56/fixes-layer-title
Browse files Browse the repository at this point in the history
Fixes the layer title to use what the user selected
  • Loading branch information
cuttlefish authored Aug 15, 2017
2 parents d28d455 + 9466219 commit 63d4960
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osgeo_importer/handlers/geonode/publish_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ def handle(self, layer, layer_config, *args, **kwargs):
layer_uuid = str(uuid.uuid4())
if layer_type == 'raster':
layer_name = os.path.splitext(os.path.basename(layer))[0]
layer_title = layer_config.get('layer_name', layer)
layer_title = layer_config.get('name', layer)
store_name = layer_name
store_type = 'coverageStore'
fields = None
elif layer_type == 'vector':
layer_name = layer
layer_title = layer_config.get('layer_name', layer)
layer_title = layer_config.get('name', layer)
store_name = self.store_name(layer_config)
store_type = 'dataStore'
fields = layer_config['fields']
elif layer_type == 'tile':
if 'layer_name' not in layer_config:
logger.warn('No layer name set, using uuid "{}" as layer name.'.format(layer_uuid))
layer_name = layer_config.get('layer_name', layer_uuid)
layer_title = layer_config.get('layer_name', layer)
layer_title = layer_config.get('name', layer)
store_name = layer_config['path']
store_type = 'tileStore'
fields = None
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ git+https://github.com/mapproxy/mapproxy.git@07552da8

# You will also need gdal/ogr. See Developer Notes section of docs.
django-osgeo-importer-client==0.0.4

# Require an earlier version of django-activity-stream as the latest breaks.
django-activity-stream==0.6.1

0 comments on commit 63d4960

Please sign in to comment.