Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 1 addition & 15 deletions python/tank/authentication/login_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,6 @@
# request thread.
THREAD_WAIT_TIMEOUT_MS = 5000


def _is_running_in_desktop():
"""
Indicate if we are in the context of the PTR desktop app.

When the PTR desktop app is used, we want to disregard the value returned
by the call to `get_shotgun_authenticator_support_web_login()` when the
target site is using Autodesk Identity.
"""
executable_name = os.path.splitext(os.path.basename(sys.executable))[0].lower()
return executable_name in ["shotgun", "shotgrid"]


class QuerySiteAndUpdateUITask(QtCore.QThread):
"""
This class uses a different thread to query the site's information and find
Expand Down Expand Up @@ -493,8 +480,7 @@ def _toggle_web(self, method_selected=None):
if os.environ.get("SGTK_FORCE_STANDARD_LOGIN_DIALOG"):
logger.info("Using the standard login dialog with the Flow Production Tracking")
else:
if _is_running_in_desktop():
can_use_web = can_use_web or self.site_info.autodesk_identity_enabled
can_use_web = can_use_web or self.site_info.autodesk_identity_enabled

# If we have full support for Web-based login, or if we enable it in our
# environment, use the Unified Login Flow for all authentication modes.
Expand Down
31 changes: 0 additions & 31 deletions tests/authentication_tests/test_interactive_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,6 @@ def test_ui_auth_with_whitespace(self):
"tank.authentication.site_info._get_site_infos",
return_value={},
)
@mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
)
def test_ui_error_management(self, *unused_mocks):
# Empty of invalid site
with self._login_dialog() as ld:
Expand Down Expand Up @@ -635,10 +631,6 @@ def test_login_dialog_exit_confirmation(self):
self.assertEqual(ld.isVisible(), False)

@suppress_generated_code_qt_warnings
@mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
)
@mock.patch(
"tank.authentication.web_login_support.get_shotgun_authenticator_support_web_login",
return_value=True,
Expand Down Expand Up @@ -778,10 +770,6 @@ def test_ui_auth_2fa(self, *mocks):
)

@suppress_generated_code_qt_warnings
@mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
)
@mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=True,
Expand Down Expand Up @@ -834,9 +822,6 @@ def test_web_login_not_supported(self):

with mock.patch(
"tank.authentication.login_dialog.ASL_AuthTask.start"
), mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
), mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=False,
Expand All @@ -858,9 +843,6 @@ def test_web_login_not_supported(self):
def test_login_dialog_method_selected_default(self):
with mock.patch(
"tank.authentication.login_dialog.ASL_AuthTask.start"
), mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
), mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=True,
Expand Down Expand Up @@ -932,9 +914,6 @@ def test_login_dialog_method_selected_default(self):
{
"SGTK_DEFAULT_AUTH_METHOD": "qt_web_login",
},
), mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=False,
), mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=False,
Expand Down Expand Up @@ -965,9 +944,6 @@ def test_login_dialog_method_selected_default(self):
def test_login_dialog_method_selected_session_cache(self):
with mock.patch(
"tank.authentication.login_dialog.ASL_AuthTask.start"
), mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
), mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=True,
Expand Down Expand Up @@ -995,9 +971,6 @@ def test_login_dialog_method_selected_session_cache(self):

# qt_web_login but method is not available
with mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=False,
), mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=False,
), mock.patch(
Expand All @@ -1015,10 +988,6 @@ def test_login_dialog_method_selected_session_cache(self):

@suppress_generated_code_qt_warnings
@mock.patch("tank.authentication.login_dialog.ASL_AuthTask.start")
@mock.patch(
"tank.authentication.login_dialog._is_running_in_desktop",
return_value=True,
)
@mock.patch(
"tank.authentication.login_dialog.get_shotgun_authenticator_support_web_login",
return_value=True,
Expand Down
Loading