I stumbled across some template issues that seem to be related to a missing user in the context.
As a simple test I launch the Shotgun Python Console from Shotgun Desktop. When my login user matches my shotgun user I get this:
So while it seems I am correctly authorized through SGDesktop I’m still missing the user in the context. Since we use the HumanUser in our templates I guess that is why the workfiles2 app now starts to have issues resolving templates. It also does not show me my tasks. And there will be probably more issues in other scripts too.
Is this supposed to happen, does my login user have to match the SG User? That used to be the case, but I had hoped that with SGDesktop it wasn’t necessary anymore.
So after some more digging this seems to be related to our script user that is still present in our configurations shotgun.yml. When I remove that things work better. For now we need to keep it for some older tools.
It seems sgtk at some point prefers the script user over the actual logged in user. Wouldn’t it make more sense the other way around and use the script user as a fallback option?
Glad you found the reason, whilst I can see why that would be desirable, the script user approach is a legacy path, and the reason it takes priority is likely for backward compatibility.
When we introduced the sign-in window, we would have wanted to preserve the original behaviour until the studio was ready to switch over to the new behaviour, so removing the script user from the shotgun.yml would then switch them over to the new behaviour.
For everyone wondering as I did:
It is possible to override the get_current_login hook and integrate it in your configuration core/hooks folder.
The config hook will get called without the need to change environment yaml.