Skip to content

Commit f1c8127

Browse files
committed
Use constant for layer name
1 parent f21765b commit f1c8127

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

arho_feature_template/core/plan_manager.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from arho_feature_template.utils.db_utils import get_existing_database_connection_names
1414
from arho_feature_template.utils.misc_utils import get_active_plan_id, get_layer_by_name, handle_unsaved_changes
1515

16+
LAYER_NAME_PLAN = "Kaava"
17+
1618

1719
class PlanManager:
1820
def __init__(self):
@@ -24,7 +26,7 @@ def add_new_plan(self):
2426
if not handle_unsaved_changes():
2527
return
2628

27-
plan_layer = get_layer_by_name("Kaava")
29+
plan_layer = get_layer_by_name(LAYER_NAME_PLAN)
2830
self.clear_all_filters()
2931

3032
if not plan_layer:
@@ -41,8 +43,7 @@ def add_new_plan(self):
4143

4244
def _feature_added(self):
4345
"""Callback for when a new feature is added to the Kaava layer."""
44-
45-
plan_layer = get_layer_by_name("Kaava")
46+
plan_layer = get_layer_by_name(LAYER_NAME_PLAN)
4647
if not plan_layer:
4748
return
4849

0 commit comments

Comments
 (0)