dots in user names are getting converted to dashes

For the last couple of weeks Systems has begun assigning user names in the format <first_name>.<last_name>. The trouble with this is that the period in that uname is getting converted to a dash. The likely culprit is this:


We use a HumanUser key in our templates. The entry looks like this:

cur_user_login: # The user that's working on the current file.
  type: str
  shotgun_entity_type: HumanUser
  shotgun_field_name: login

I can adjust process_folder_name.py to skip the "HumanUser" entity types, but I don't know what other code might be performing these changes.

Could you tell me all the points in SGTK that could be converting periods (.) to dashes (-)?

댓글 1개

  • 0
    Manne Öhrström


    Yepp, you are quite right! - the process_folder_name core hook is the place where periods are replaced with dashes. Updating the logic in this file should be enough to update both the folder creation and the key handling in the template system!

    Basically, you need to make modifications down the bottom of the file along the following lines (untested code!):

            # replace all non-alphanumeric characters with dashes, 
            # except for the project entity, where accept slashes
            # as a valid character.
            if entity_type == "HumanUser" and field_name == "login":
                # do not do any smart conversions for login names
                # carry out standard conversions to remove problematic characters
                preserve_slashes = (entity_type == "Project")
                str_value = self._replace_non_alphanumeric(str_value, preserve_slashes)

    Let me know how it goes!

댓글을 남기려면 로그인하세요.