diff --git a/data/model/legacy.py b/data/model/legacy.py index 9cccfa82b..e5b49bc53 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1816,7 +1816,7 @@ def get_repository_delegate_tokens(namespace_name, repository_name): def get_repo_delegate_token(namespace_name, repository_name, code): repo_query = get_repository_delegate_tokens(namespace_name, repository_name) - found = list(repo_query.where(AccessToken.code == code)) + found = list(repo_query.where(AccessToken.code == code).limit(1)) if found: return found[0]