Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching projects only if the new project is not already the current project #1380

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}")
Loading