Skip to content

Commit

Permalink
Store description as None
Browse files Browse the repository at this point in the history
  • Loading branch information
index-git committed Dec 19, 2024
1 parent 4271563 commit 7cab949
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/layman/layer/geoserver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down
7 changes: 4 additions & 3 deletions src/layman/layer/rest_workspace_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/layman/layer/rest_workspace_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def post(workspace):
title = layername

# DESCRIPTION
description = request.form.get('description', '')
description = request.form.get('description')

# Style
style_file = None
Expand Down

0 comments on commit 7cab949

Please sign in to comment.