Skip to content

Commit

Permalink
Stats API - Check we have correct metadata in the JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed May 28, 2024
1 parent 49ec2c9 commit 93899a7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lizmap/plausible.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,15 @@ def _send_stat_event(self) -> bool:
# lwc_version_light → 3.7.7
lwc_version_branch = LwcVersions.find_from_metadata(metadata)
# lwc_version_branch → 3.7 as Python enum
qgis_server_version = metadata.get('qgis_server_info').get('metadata').get('version')
qgis_server_info = metadata.get('qgis_server_info')
if not qgis_server_info:
return False
metadata = qgis_server_info.get('metadata')
if not metadata:
return False
qgis_server_version = metadata.get('version')
if not qgis_server_version:
return False
# qgis_server_version → 3.34.6
qgis_server_branch = '.'.join(qgis_server_version.split('.')[0:2])
# qgis_server_branch → 3.34
Expand Down

0 comments on commit 93899a7

Please sign in to comment.