Skip to content

Commit

Permalink
Merge pull request #1380 from mariashoeller/project_switching_issue_1355
Browse files Browse the repository at this point in the history
LGTM!
  • Loading branch information
mrvisscher authored Sep 27, 2024
2 parents 60be3f2 + ad7b9f1 commit 1075bcd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions activity_browser/actions/project/project_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@ class ProjectSwitch(ABAction):
@staticmethod
@exception_dialogs
def run(project_name: str):
bd.projects.set_current(project_name)
log.info(f"Brightway2 current project: {project_name}")

# compare the new to the current project name and switch to the new one if the two are not the same
if not project_name == bd.projects.current:
bd.projects.set_current(project_name)
log.info(f"Brightway2 current project: {project_name}")

# if the project to be switched to is already the current project, do nothing
else:
log.debug(f"Brightway2 already selected: {project_name}")

0 comments on commit 1075bcd

Please sign in to comment.