Skip to content

Users: Add 'attrib' argument to 'get_user' - #377

Open
BigRoy wants to merge 1 commit into
developfrom
enhancement/get-user-attrib-arg
Open

BigRoy wants to merge 1 commit into
developfrom
enhancement/get-user-attrib-arg

Conversation

@BigRoy

@BigRoy BigRoy commented Nov 2, 2026

Copy link
Copy Markdown
Member

Changelog Description

get_user has a new attrib argument. With attrib=False it doesn't fill missing user attributes with their default values, which saves the request for attribute schemas. Default is True, so behavior doesn't change.

Requested in ynput/ayon-launcher#346, which needs only the username.

Additional info

  • get_user makes 1 request instead of 2 with attrib=False.
  • login and create_workfile_info (server older than 1.1.3) use only the username, so they now call get_user(attrib=False).
  • own_attributes works the same with either value.

Testing notes:

  1. pytest tests/test_get_user_attrib.py (no server needed).

@BigRoy BigRoy added the type: enhancement New feature or request label Nov 2, 2026
@BigRoy
BigRoy requested review from iLLiCiTiT and a lite review from Copilot and removed request for Copilot November 2, 2026 13:19
@BigRoy BigRoy self-assigned this Nov 2, 2026
@BigRoy

BigRoy commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

This should be implemented the way we discussed @iLLiCiTiT

Comment thread ayon_api/_api.py
def get_user(
username: str | None = None,
own_attributes: bool = False,
attrib: bool = True,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
attrib: bool = True,
fill_attrib: bool = True,

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants