Changeset - e81332582fc9
[Not reviewed]
default
0 7 0
Mads Kiilerich - 8 years ago 2017-09-14 02:08:06
mads@kiilerich.com
controllers: drop unused totalRecords and startIndex

We don't want it just for testing.
7 files changed with 5 insertions and 13 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/repo_groups.py
Show inline comments
 
@@ -138,14 +138,12 @@ class RepoGroupsController(BaseControlle
 
                "owner": h.person(repo_gr.owner),
 
                "action": repo_group_actions(repo_gr.group_id, repo_gr.group_name,
 
                                             repo_count)
 
            })
 

	
 
        c.data = {
 
            "totalRecords": total_records,
 
            "startIndex": 0,
 
            "sort": None,
 
            "dir": "asc",
 
            "records": repo_groups_data
 
        }
 

	
 
        return render('admin/repo_groups/repo_groups.html')
kallithea/controllers/admin/user_groups.py
Show inline comments
 
@@ -116,14 +116,12 @@ class UserGroupsController(BaseControlle
 
                "active": h.boolicon(user_gr.users_group_active),
 
                "owner": h.person(user_gr.owner.username),
 
                "action": user_group_actions(user_gr.users_group_id, user_gr.users_group_name)
 
            })
 

	
 
        c.data = {
 
            "totalRecords": total_records,
 
            "startIndex": 0,
 
            "sort": None,
 
            "dir": "asc",
 
            "records": user_groups_data
 
        }
 

	
 
        return render('admin/user_groups/user_groups.html')
kallithea/controllers/admin/users.py
Show inline comments
 
@@ -100,14 +100,12 @@ class UsersController(BaseController):
 
                "extern_type": user.extern_type,
 
                "extern_name": user.extern_name,
 
                "action": user_actions(user.user_id, user.username),
 
            })
 

	
 
        c.data = {
 
            "totalRecords": total_records,
 
            "startIndex": 0,
 
            "sort": None,
 
            "dir": "asc",
 
            "records": users_data
 
        }
 

	
 
        return render('admin/users/users.html')
kallithea/model/repo.py
Show inline comments
 
@@ -227,14 +227,12 @@ class RepoModel(object):
 
                    "owner": owner_actions(repo.owner_id,
 
                                           h.person(repo.owner))
 
                })
 
            repos_data.append(row)
 

	
 
        return {
 
            "totalRecords": len(repos_list),
 
            "startIndex": 0,
 
            "sort": "name",
 
            "dir": "asc",
 
            "records": repos_data
 
        }
 

	
 
    def _get_defaults(self, repo_name):
kallithea/tests/functional/test_home.py
Show inline comments
 
@@ -17,13 +17,12 @@ class TestHomeController(TestController)
 
        # if global permission is set
 
        response.mustcontain('Add Repository')
 

	
 
        response.mustcontain('<span class="repotag">git')
 

	
 
        # html in javascript variable:
 
        response.mustcontain('var data = ({"totalRecords": %s' % Repository.query().count())
 
        response.mustcontain(r'href=\"/%s\"' % HG_REPO)
 

	
 
        response.mustcontain(r'\x3ci class=\"icon-globe\"')
 

	
 
        response.mustcontain(r'\"fixes issue with having custom format for git-log\n\"')
 
        response.mustcontain(r'\"/%s/changeset/5f2c6ee195929b0be80749243c18121c9864a3b3\"' % GIT_REPO)
kallithea/tests/functional/test_my_account.py
Show inline comments
 
@@ -29,21 +29,23 @@ class TestMyAccountController(TestContro
 

	
 
    def test_my_account_my_repos(self):
 
        self.log_user()
 
        response = self.app.get(url('my_account_repos'))
 
        cnt = Repository.query().filter(Repository.owner ==
 
                           User.get_by_username(TEST_USER_ADMIN_LOGIN)).count()
 
        response.mustcontain('"totalRecords": %s' % cnt)
 
        response.mustcontain('"raw_name": "%s"' % HG_REPO)
 
        response.mustcontain('"just_name": "%s"' % GIT_REPO)
 

	
 
    def test_my_account_my_watched(self):
 
        self.log_user()
 
        response = self.app.get(url('my_account_watched'))
 

	
 
        cnt = UserFollowing.query().filter(UserFollowing.user ==
 
                            User.get_by_username(TEST_USER_ADMIN_LOGIN)).count()
 
        response.mustcontain('"totalRecords": %s' % cnt)
 
        response.mustcontain('"raw_name": "%s"' % HG_REPO)
 
        response.mustcontain('"just_name": "%s"' % GIT_REPO)
 

	
 
    def test_my_account_my_emails(self):
 
        self.log_user()
 
        response = self.app.get(url('my_account_emails'))
 
        response.mustcontain('No additional emails specified')
 

	
kallithea/tests/functional/test_repo_groups.py
Show inline comments
 
@@ -3,13 +3,13 @@ from kallithea.tests.base import *
 

	
 
class TestRepoGroupsController(TestController):
 

	
 
    def test_index(self):
 
        self.log_user()
 
        response = self.app.get(url('repos_groups'))
 
        response.mustcontain('{"totalRecords": 0, "sort": null, "startIndex": 0, "dir": "asc", "records": []}')
 
        response.mustcontain('"records": []')
 

	
 
    def test_new(self):
 
        self.log_user()
 
        response = self.app.get(url('new_repos_group'))
 

	
 
    def test_create(self):
 
@@ -54,13 +54,12 @@ class TestRepoGroupsController(TestContr
 
        response.mustcontain('name="group_name" type="text" value="%s"' % group_name)
 
        response.mustcontain(no='<!-- for: group_description -->')
 
        response.mustcontain('>lolo<')
 

	
 
        # listing
 
        response = self.app.get(url('repos_groups'))
 
        response.mustcontain('"totalRecords": 1')
 
        response.mustcontain('raw_name": "%s"' % group_name)
 

	
 
        # show
 
        response = self.app.get(url('repos_group', group_name=group_name))
 
        response.mustcontain('href="/_admin/repo_groups/%s/edit"' % group_name)
 

	
0 comments (0 inline, 0 general)