Make sure to join the Repo table on its namespace user and its visibility so we don't issue additional queries from the starred repos API call

This commit is contained in:
Joseph Schorr 2015-05-07 16:18:17 -04:00
parent 23fafa6b4a
commit b50600cde8

View file

@ -2830,8 +2830,11 @@ def get_user_starred_repositories(user, limit=None, page=None):
query = (Repository
.select()
.join(Star)
.switch(Repository)
.join(User)
.where(User.id == user.id)
.switch(Repository)
.join(Visibility)
.where(Star.user == user)
.order_by(Star.created))
if page and limit: