Skip to content

Commit 477f048

Browse files
committed
Filter duplicate print layouts (layout in project takes precedence)
1 parent 3687455 commit 477f048

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/config_generator/theme_reader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ def read_metadata_for_theme(self, item):
9191
self.logger.warning(
9292
"Could not get WMS capabilities for %s" % url
9393
)
94-
wms_capabilities["print_templates"] = wms_capabilities.get('print_templates', []) + self.print_layouts
94+
project_layouts = wms_capabilities.get('print_templates', [])
95+
project_layouts_names = [layout['name'] for layout in project_layouts]
96+
wms_capabilities["print_templates"] = project_layouts + \
97+
[layout for layout in self.print_layouts if layout["name"] not in project_layouts_names]
9598

9699
wfs_capabilities = {}
97100
if self.generate_wfs_services:

0 commit comments

Comments
 (0)