From 17f605a9ef1f542cc2db9580d7dcce9cfa81a21c Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Sun, 9 Nov 2014 15:50:50 -0500 Subject: [PATCH] Select only a single token. --- data/model/legacy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]