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

Enhancement/kitsu to ayon name conversions #55

Conversation

scottmcdonnell
Copy link
Contributor

@scottmcdonnell scottmcdonnell commented Jun 5, 2024

Allows Kitsu names to be converted to a valid Ayon name.

  • Spaces are converted
  • special characters are removed
  • User names have accent characters converted to their closest equivalents
  • ø =>oe link

for tests:

cd tests
poetry run pytest tests/test_addon_helpers.py 


username = remove_accents(
f"{entity_dict['first_name']}.{entity_dict['last_name']}".lower().strip()
logging.info(
Copy link
Member

@iLLiCiTiT iLLiCiTiT Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we store the first and last name to variables? There is a lot entity_dict['first_name'] and entity_dict['last_name'] everywhere. Also some are using .get( and some are directly expecting the key to be there, are the values always filled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, addressed in ef114ae

@martastain martastain linked an issue Jun 5, 2024 that may be closed by this pull request
@scottmcdonnell
Copy link
Contributor Author

scottmcdonnell commented Jun 6, 2024

I looked at slugify but it seems to be more restrictive than the AYON validation which allows capitals, hyphens and dots.

slugify(name, separator="_", lower=False) produces Test_Project_123 for the following test:

assert (
        to_entity_name("Test-Project.123 ") == "Test-Project.123"
    ), "hyphens and dots ARE allowed"

I need to use capitalised project codes and short names for our naming convention so I would suggest the addon does not convert to lower and be overly restrictive unless it has to be.

@martastain martastain merged commit f41ff93 into ynput:develop Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Redirect to login screen when using sync button
3 participants