diff --git a/src/layman/layer/geoserver/tasks.py b/src/layman/layer/geoserver/tasks.py index 4cf677b47..d5098f12a 100644 --- a/src/layman/layer/geoserver/tasks.py +++ b/src/layman/layer/geoserver/tasks.py @@ -45,7 +45,6 @@ def refresh_wms( geodata_type = info['geodata_type'] crs = info['native_crs'] - assert description is not None assert title is not None geoserver_workspace = wms.get_geoserver_workspace(workspace) geoserver.ensure_workspace(workspace) @@ -152,7 +151,6 @@ def refresh_wfs( if geodata_type != settings.GEODATA_TYPE_VECTOR: raise NotImplementedError(f"Unknown geodata type: {geodata_type}") - assert description is not None assert title is not None geoserver.ensure_workspace(workspace) diff --git a/src/layman/layer/rest_workspace_layer.py b/src/layman/layer/rest_workspace_layer.py index cdda1fccf..3137d1c59 100644 --- a/src/layman/layer/rest_workspace_layer.py +++ b/src/layman/layer/rest_workspace_layer.py @@ -55,7 +55,7 @@ def patch(workspace, layername): 'original_data_source', ]}) kwargs = { 'title': info.get('title', info['name']) or '', - 'description': info.get('description', '') or '', + 'description': info.get('description'), } # FILE @@ -109,8 +109,9 @@ def patch(workspace, layername): kwargs['title'] = request.form['title'] # DESCRIPTION - if len(request.form.get('description', '')) > 0: - kwargs['description'] = request.form['description'] + description = request.form.get('description') + if description and len(description) > 0: + kwargs['description'] = description # SLD style_file = None diff --git a/src/layman/layer/rest_workspace_layers.py b/src/layman/layer/rest_workspace_layers.py index eac646104..4b9939876 100644 --- a/src/layman/layer/rest_workspace_layers.py +++ b/src/layman/layer/rest_workspace_layers.py @@ -145,7 +145,7 @@ def post(workspace): title = layername # DESCRIPTION - description = request.form.get('description', '') + description = request.form.get('description') # Style style_file = None