diff --git a/lizmap/dialogs/main.py b/lizmap/dialogs/main.py index 3ff5c81d..a971780f 100755 --- a/lizmap/dialogs/main.py +++ b/lizmap/dialogs/main.py @@ -673,13 +673,16 @@ def current_server_info(self, info: ServerComboData): """ Return the current LWC server information from the server combobox. """ return self.server_combo.currentData(info) - def current_lwc_version(self) -> Optional[LwcVersions]: + def current_lwc_version(self, default_value: bool = True) -> Optional[LwcVersions]: """ Return the current LWC version from the server combobox. """ metadata = self.current_server_info(ServerComboData.JsonMetadata.value) # In tests, we might not have metadata in the combobox if metadata and metadata.get('info'): return LwcVersions.find_from_metadata(metadata) + if not default_value: + return None + if self._lwc_version: return self._lwc_version diff --git a/lizmap/plausible.py b/lizmap/plausible.py index 362a0fbf..3c5d0c00 100644 --- a/lizmap/plausible.py +++ b/lizmap/plausible.py @@ -60,6 +60,10 @@ def request_stat_event(self) -> bool: # If running on CI, do not send stats return False + if not self.dialog.current_lwc_version(default_value=False): + # Let's wait to have the JSON in the combobox + return False + current = QDateTime().currentDateTimeUtc() if self.previous_date and self.previous_date.secsTo(current) < MIN_SECONDS: # Not more than one request per hour