add attribute to the function to be able to detect if new version should be used

This commit is contained in:
Jakub Trllo 2025-10-06 13:10:39 +02:00
parent f11800f1e7
commit b665bf3f79

View file

@ -725,6 +725,11 @@ def get_representation_path_with_roots(
def _get_representation_path_decorator(func):
# Add an attribute to the function so addons can check if the new variant
# of the function is available.
# >>> getattr(get_representation_path, "version", None) == 2
# >>> True
setattr(func, "version", 2)
@wraps(func)
def inner(*args, **kwargs):
from ayon_core.pipeline import get_current_project_name