Select only a single token.

This commit is contained in:
Joseph Schorr 2014-11-09 15:50:50 -05:00
parent 691be49817
commit 17f605a9ef

View file

@ -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]