diff --git a/Mergin/plugin.py b/Mergin/plugin.py
index b0587713..e5d6b3d6 100644
--- a/Mergin/plugin.py
+++ b/Mergin/plugin.py
@@ -158,8 +158,6 @@ def initGui(self):
self.enable_toolbar_actions()
- self.post_login()
-
self.data_item_provider = DataItemProvider(self)
QgsApplication.instance().dataItemProviderRegistry().addProvider(self.data_item_provider)
# related to https://github.com/MerginMaps/qgis-mergin-plugin/issues/3
@@ -249,7 +247,6 @@ def on_config_changed(self):
"""Called when plugin config (connection settings) were changed."""
self.create_manager()
self.enable_toolbar_actions()
- self.post_login()
def open_configured_url(self, path=None):
"""Opens configured Mergin Maps server url in default browser
@@ -351,20 +348,21 @@ def set_current_workspace(self, workspace):
if self.mc.server_type() == ServerType.SAAS and workspace_id:
# check action required flag
- service_response = self.mc.workspace_service(workspace_id)
-
- if service_response and type(service_response) is dict:
- requires_action = service_response.get("action_required", False)
-
- if requires_action:
- iface.messageBar().pushMessage(
- "Mergin Maps",
- "Your attention is required. Please visit the "
- f""
- "Mergin dashboard",
- level=Qgis.Critical,
- duration=0,
- )
+ try:
+ service_response = self.mc.workspace_service(workspace_id)
+ except ClientError as e:
+ return
+
+ requires_action = service_response.get("action_required", False)
+ if requires_action:
+ iface.messageBar().pushMessage(
+ "Mergin Maps",
+ "Your attention is required. Please visit the "
+ f""
+ "Mergin dashboard",
+ level=Qgis.Critical,
+ duration=0,
+ )
def choose_active_workspace(self):
"""
@@ -402,32 +400,6 @@ def choose_active_workspace(self):
self.set_current_workspace(workspace)
- def post_login(self):
- """Groups actions that needs to be done when auth information changes"""
- if not self.mc:
- return
-
- if self.mc.server_type() != ServerType.OLD:
- return
-
- settings = QSettings()
-
- # check action required flag
- service_response = self.mc.user_service()
-
- if service_response and type(service_response) is dict:
- requires_action = service_response.get("action_required", False)
-
- if requires_action:
- iface.messageBar().pushMessage(
- "Mergin Maps",
- "Your attention is required. Please visit the "
- f""
- "Mergin dashboard",
- level=Qgis.Critical,
- duration=0,
- )
-
def create_new_project(self):
"""Open new Mergin Maps project creation dialog."""
check_result = unsaved_project_check()