##// END OF EJS Templates
db: prevent empty IN queries that generally are performance problem, and triggers sql warnings.
marcink -
r2176:d21fb0df default
parent child Browse files
Show More
@@ -100,7 +100,7 b' class AdminUserGroupsView(BaseAppView, D'
100 auth_user_group_list = UserGroupList(
100 auth_user_group_list = UserGroupList(
101 UserGroup.query().all(), perm_set=['usergroup.admin'])
101 UserGroup.query().all(), perm_set=['usergroup.admin'])
102
102
103 allowed_ids = []
103 allowed_ids = [-1]
104 for user_group in auth_user_group_list:
104 for user_group in auth_user_group_list:
105 allowed_ids.append(user_group.users_group_id)
105 allowed_ids.append(user_group.users_group_id)
106
106
@@ -90,7 +90,7 b' class RepoForksView(RepoAppView, DataGri'
90 acl_check = HasRepoPermissionAny(
90 acl_check = HasRepoPermissionAny(
91 'repository.read', 'repository.write', 'repository.admin')
91 'repository.read', 'repository.write', 'repository.admin')
92 repo_id = self.db_repo.repo_id
92 repo_id = self.db_repo.repo_id
93 allowed_ids = []
93 allowed_ids = [-1]
94 for f in Repository.query().filter(Repository.fork_id == repo_id):
94 for f in Repository.query().filter(Repository.fork_id == repo_id):
95 if acl_check(f.repo_name, 'get forks check'):
95 if acl_check(f.repo_name, 'get forks check'):
96 allowed_ids.append(f.repo_id)
96 allowed_ids.append(f.repo_id)
General Comments 0
You need to be logged in to leave comments. Login now