Skip to content

Commit 1075bcd

Browse files
authored
Merge pull request #1380 from mariashoeller/project_switching_issue_1355
LGTM!
2 parents 60be3f2 + ad7b9f1 commit 1075bcd

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

activity_browser/actions/project/project_switch.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ class ProjectSwitch(ABAction):
1717
@staticmethod
1818
@exception_dialogs
1919
def run(project_name: str):
20-
bd.projects.set_current(project_name)
21-
log.info(f"Brightway2 current project: {project_name}")
20+
21+
# compare the new to the current project name and switch to the new one if the two are not the same
22+
if not project_name == bd.projects.current:
23+
bd.projects.set_current(project_name)
24+
log.info(f"Brightway2 current project: {project_name}")
25+
26+
# if the project to be switched to is already the current project, do nothing
27+
else:
28+
log.debug(f"Brightway2 already selected: {project_name}")

0 commit comments

Comments
 (0)