Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Python review #59

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ stages:
- deploy
- release

#qgis-server:
# stage: test
# parallel:
# matrix:
# - QGIS_VERSION: [
# "3.16",
# "3.22",
# "3.28",
# "nightly-release",
# ]
# script:
# - make tests FLAVOR=${QGIS_VERSION}
# tags:
# - infrav3
qgis-server:
stage: test
parallel:
matrix:
- QGIS_VERSION: [
"3.16",
"3.22",
"3.28",
"nightly-release",
]
script:
- make tests FLAVOR=${QGIS_VERSION}
tags:
- infrav3

flake:
stage: test
Expand Down
10 changes: 5 additions & 5 deletions lizmap_server/legend_onoff_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def _setup_legend(layer: QgsMapLayer, qs: str, onoff: bool):
if layer_name == '' or key_list == '':
continue
# for the layer
if layer_name != layer.shortName() and layer_name != layer.name() and layer_name != layer.id():
if layer_name not in (layer.shortName(), layer.name(), layer.id()):
continue

for key in key_list.split(','):
Expand All @@ -46,15 +46,15 @@ def layerPermissions(self, layer: QgsMapLayer) -> QgsAccessControlFilter.LayerPe
if 'LEGEND_ON' not in params and 'LEGEND_OFF' not in params:
return rights

styles = params['STYLES'].split(',') if 'STYLES' in params and params['STYLES'] else []
styles = params.get('STYLES', '').split(',')

if len(styles) == 0:
styles = [params['STYLE']] if 'STYLE' in params and params['STYLE'] else []
styles = params.get('STYLE', [])

layers = params['LAYERS'].split(',') if 'LAYERS' in params and params['LAYERS'] else []
layers = params.get('LAYERS', '').split(',')

if len(layers) == 0:
layers = [params['LAYER']] if 'LAYER' in params and params['LAYER'] else []
layers = params.get('LAYER', [])

# noinspection PyBroadException
try:
Expand Down
Loading