Skip to content

Commit 037f20e

Browse files
committed
fix: initiate linetool in reload_geocode_completer not reindex_list_items
1 parent 76822ed commit 037f20e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

ORStools/gui/ORStoolsDialog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ def option_chosen(name, lineEdit):
416416
for feature in data["features"]
417417
if feature["properties"]["name"] == name
418418
][0]
419+
self.line_tool = maptools.LineTool(self)
419420
self.add_geocoded_item(coords, lineEdit, name)
420421
completer.activated.disconnect()
421422
lineEdit.setText("")
@@ -616,7 +617,6 @@ def _reindex_list_items(self) -> None:
616617
self.annotations.append(annotation)
617618
self.project.annotationManager().addAnnotation(annotation)
618619
try:
619-
self.line_tool = maptools.LineTool(self)
620620
self.line_tool.create_rubber_band()
621621
except Exception as e:
622622
if "Connection refused" in str(e):

tests/conftest.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ def pytest_sessionstart(session):
1818
Called after the Session object has been created and
1919
before performing collection and entering the run test loop.
2020
"""
21-
if data["providers"][0]["key"] == "":
22-
data["providers"][0]["key"] = os.environ.get("ORS_API_KEY")
23-
s.setValue("ORStools/config", data)
24-
else:
25-
raise ValueError("API key is not empty.")
21+
data["providers"][0]["key"] = os.environ.get("ORS_API_KEY")
22+
s.setValue("ORStools/config", data)
2623

2724

2825
def pytest_sessionfinish(session, exitstatus):

0 commit comments

Comments
 (0)