Skip to content

Commit

Permalink
Merge pull request #59 from Gustry/pyton-review
Browse files Browse the repository at this point in the history
Minor Python review
  • Loading branch information
Gustry authored Jan 29, 2024
2 parents 4f788ff + d4ddadf commit 43a4a42
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
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

0 comments on commit 43a4a42

Please sign in to comment.