Changeset - 69750b518137
[Not reviewed]
default
0 1 0
Mads Kiilerich - 9 years ago 2016-05-23 18:02:33
madski@unity3d.com
admin: simplify query for owned and followed repositories
1 file changed with 5 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/my_account.py
Show inline comments
 
@@ -75,16 +75,15 @@ class MyAccountController(BaseController
 
    def _load_my_repos_data(self, watched=False):
 
        if watched:
 
            admin = False
 
            repos_list = [x.follows_repository for x in
 
                          Session().query(UserFollowing).filter(
 
                              UserFollowing.user_id ==
 
                              self.authuser.user_id).all()]
 
            repos_list = Session().query(Repository) \
 
                         .join(UserFollowing) \
 
                         .filter(UserFollowing.user_id ==
 
                                 self.authuser.user_id).all()
 
        else:
 
            admin = True
 
            repos_list = Session().query(Repository) \
 
                         .filter(Repository.user_id ==
 
                                 self.authuser.user_id) \
 
                         .order_by(func.lower(Repository.repo_name)).all()
 
                                 self.authuser.user_id).all()
 

	
 
        repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list,
 
                                                   admin=admin)
0 comments (0 inline, 0 general)