Skip to content

Commit

Permalink
using Qurl instead of urllib
Browse files Browse the repository at this point in the history
  • Loading branch information
Gpetrak committed Nov 13, 2024
1 parent 7b76fa1 commit 785c802
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/qgis_geonode/gui/connection_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import re
import typing
import uuid
from urllib.parse import urlparse


import qgis.core
from qgis.gui import QgsMessageBar
Expand Down Expand Up @@ -118,9 +116,11 @@ def __init__(self, connection_settings: typing.Optional[ConnectionSettings] = No

def validate_geonode_url(self):

inserted_url = self.url_le.text().strip().rstrip("#/")
parsed_url = urlparse(inserted_url)
if parsed_url.path != "":
inserted_url = QtCore.QUrl(self.url_le.text().strip().rstrip("#/"))

if inserted_url.isValid() == False:
return False
elif inserted_url.path() != "":
return False
else:
return True
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_connection(self):
qgis.core.QgsApplication.taskManager().addTask(self.discovery_task)
else:
self.enable_post_test_connection_buttons()
message = "Please insert only the domain part from the GeoNode URL"
message = "Please insert only the domain of a valid GeoNode URL"
level = qgis.core.Qgis.Critical
utils.show_message(self.bar, message, level)

Expand Down

0 comments on commit 785c802

Please sign in to comment.