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

Fix issue with tk-desktop stomping on a specified authenticated user with the default user #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 13 additions & 10 deletions python/tk_desktop/desktop_engine_site_implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,19 @@ def run(self, splash, version, **kwargs):
if self.uses_legacy_authentication():
self._migrate_credentials()

# We need to initialize current login
# We know for sure there is a default user, since either the migration was done
# or we logged in as an actual user with the new installer.
human_user = ShotgunAuthenticator(
# We don't want to get the script user, but the human user, so tell the
# CoreDefaultsManager manager that we are not interested in the script user. Do not use
# the regular shotgun_authentication.DefaultsManager to get this user because it will
# not know about proxy information.
sgtk.util.CoreDefaultsManager(mask_script_user=True)
).get_default_user()
human_user = sgtk.get_authenticated_user()
if not human_user:
# We need to initialize current login
# We know for sure there is a default user, since either the migration was done
# or we logged in as an actual user with the new installer.
human_user = ShotgunAuthenticator(
# We don't want to get the script user, but the human user, so tell the
# CoreDefaultsManager manager that we are not interested in the script user. Do not use
# the regular shotgun_authentication.DefaultsManager to get this user because it will
# not know about proxy information.
sgtk.authentication.CoreDefaultsManager(mask_script_user=True)
).get_default_user()

# Cache the user so we can refresh the credentials before launching a background process
self._user = human_user
# Retrieve the current logged in user information. This will be used when creating
Expand Down