Skip to content

Commit

Permalink
Fix the checker if we use a service
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Nov 20, 2023
1 parent e6b6383 commit a05c0f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
11 changes: 6 additions & 5 deletions lizmap/project_checker_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def project_safeguards_checks(
# We can continue
continue

if datasource.host().endswith(CLOUD_DOMAIN) or force_pg_user_pass:
if not datasource.username() or not datasource.password():
results[SourceLayer(layer.name(), layer.id())] = Checks.PgForceUserPass
if not datasource.service():
if datasource.host().endswith(CLOUD_DOMAIN) or force_pg_user_pass:
if not datasource.username() or not datasource.password():
results[SourceLayer(layer.name(), layer.id())] = Checks.PgForceUserPass

# We can continue
continue
# We can continue
continue

# Only vector/raster file based

Expand Down
7 changes: 7 additions & 0 deletions lizmap/resources/ui/ui_lizmap.ui
Original file line number Diff line number Diff line change
Expand Up @@ -4902,6 +4902,13 @@ This is different to the map maximum extent (defined in QGIS project properties,
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_86">
<property name="text">
<string>Safest conditions are when all checkbox are checked</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="safe_other_drive">
<property name="text">
Expand Down
8 changes: 4 additions & 4 deletions lizmap/widgets/check_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def marker(self) -> QIcon:
return QIcon(pixmap)

def __str__(self):
return f'Severity {self.data} : {self.label}'
return f'<Severity {self.data} : {self.label}>'


class Severities(Severity, Enum):
Expand All @@ -89,7 +89,7 @@ def __init__(self, data: str, label: str, tooltip: str, icon: QIcon):
self.tooltip = tooltip

def __str__(self):
return f'{self.data} : {self.label}'
return f'<{self.data} : {self.label}>'


class Levels:
Expand Down Expand Up @@ -192,7 +192,7 @@ def html_tooltip(self, lizmap_cloud: bool = False) -> str:
return html_str

def __str__(self):
return f'{self.title} : {self.description_text(False)} :{self.level}{self.severity}'
return f'<{self.title} : {self.description_text(False)} :{self.level}{self.severity}>'


# Check QGIS_VERSION_INT
Expand Down Expand Up @@ -607,7 +607,7 @@ def __init__(self, source: str, check: Check, source_type=None):
self.source_type = source_type

def __str__(self):
return f'{self.source} : {self.check}'
return f'<{self.source} : {self.check}>'


class TableCheck(QTableWidget):
Expand Down

0 comments on commit a05c0f8

Please sign in to comment.