From 2e5d8bc1ed1f0703cf0f8ff459595971883b7ff7 Mon Sep 17 00:00:00 2001 From: lian Date: Tue, 27 Jun 2017 16:32:19 +0800 Subject: [PATCH] update get repo info api add `file_count` and rm `desc` --- seahub/api2/views.py | 2 +- tests/api/test_repo.py | 2 +- tests/api/test_repos.py | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/seahub/api2/views.py b/seahub/api2/views.py index 854cad212f..add96ac036 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -800,12 +800,12 @@ class Repo(APIView): "id":repo.id, "owner":owner, "name":repo.name, - "desc":repo.desc, "mtime":repo.latest_modify, "size":repo.size, "encrypted":repo.encrypted, "root":root_id, "permission": check_permission(repo.id, username), + "file_count": repo.file_count, } if repo.encrypted: repo_json["enc_version"] = repo.enc_version diff --git a/tests/api/test_repo.py b/tests/api/test_repo.py index 37f16d08f4..5af39d09aa 100644 --- a/tests/api/test_repo.py +++ b/tests/api/test_repo.py @@ -21,8 +21,8 @@ class RepoTest(BaseTestCase): self.assertIsNotNone(json_resp['size']) self.assertIsNotNone(json_resp['name']) self.assertIsNotNone(json_resp['root']) - self.assertIsNotNone(json_resp['desc']) self.assertIsNotNone(json_resp['type']) + self.assertIsNotNone(json_resp['file_count']) def test_can_delete(self): self.login_as(self.user) diff --git a/tests/api/test_repos.py b/tests/api/test_repos.py index fa1bdfae73..f3948dbfe3 100644 --- a/tests/api/test_repos.py +++ b/tests/api/test_repos.py @@ -50,7 +50,6 @@ class ReposApiTest(ApiTestBase): self.assertIsNotNone(rinfo['size']) self.assertIsNotNone(rinfo['name']) self.assertIsNotNone(rinfo['root']) - self.assertIsNotNone(rinfo['desc']) self.assertIsNotNone(rinfo['type']) # elf.assertIsNotNone(rinfo['password_need']) # allow null here @@ -73,7 +72,6 @@ class ReposApiTest(ApiTestBase): #self.assertIsNotNone(commit['parent_id']) #allow null self.assertIsNotNone(commit['new_merge']) self.assertIsNotNone(commit['repo_id']) - self.assertIsNotNone(commit['desc']) self.assertIsNotNone(commit['id']) self.assertIsNotNone(commit['conflict']) #self.assertIsNotNone(commit['second_parent_id']) #allow null