Skip to content

Commit

Permalink
actually call function from teksi#302
Browse files Browse the repository at this point in the history
  • Loading branch information
cymed committed Jul 17, 2024
1 parent f0251af commit 5a98081
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions plugin/teksi_wastewater/teksi_wastewater_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from .tools.twwnetwork import TwwGraphManager
from .utils.plugin_utils import plugin_root_path
from .utils.translation import setup_i18n
from .utils.tww_validity_check import tww_check_oid_prefix
from .utils.tww_validity_check import tww_check_oid_prefix,tww_check_fk_defaults
from .utils.twwlayermanager import TwwLayerManager, TwwLayerNotifier
from .utils.twwlogging import TwwQgsLogHandler

Expand Down Expand Up @@ -310,25 +310,25 @@ def initGui(self):
QgsApplication.processingRegistry().addProvider(self.processing_provider)

self.network_layer_notifier.layersAdded([])

# check if database defaults are set
self.iface.projectRead.connect(
self.tww_validity_check
)

def tww_validity_check(self):
pg_layer = TwwLayerManager.layer("vw_tww_wastewater_structure")
if not pg_layer:
self.iface.messageBar().pushMessage(
"Error",
"Could not determine the Postgres connection information. Make sure the TWW project is loaded.",
level=Qgis.Critical,
)

pgservice = pg_layer.dataProvider().uri().service()
msgs = tww_check_oid_prefix(pgservice)
msgs.extend(tww_check_oid_prefix(pgservice))
for msg in msgs:
self.iface.messageBar().pushMessage(
"Error",
msg,
level=Qgis.Critical,
)
if pg_layer:
pgservice = pg_layer.dataProvider().uri().service()
msgs = tww_check_oid_prefix(pgservice)
msgs.extend(tww_check_oid_prefix(pgservice))
msgs.extend(tww_check_fk_defaults(pgservice))
for msg in msgs:
self.iface.messageBar().pushMessage(
"Error",
msg,
level=Qgis.Critical,
)

def unload(self):
"""
Expand Down

0 comments on commit 5a98081

Please sign in to comment.