1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-09 02:42:47 +00:00

Add org personal page, and inner pub page

This commit is contained in:
xiez
2012-08-29 13:40:47 +08:00
parent 06de726050
commit 02b3f6f0af
8 changed files with 179 additions and 18 deletions

View File

@@ -264,6 +264,25 @@ def get_org_repos(org_id, start, limit):
return repos
def list_org_inner_pub_repos(org_id, start=None, limit=None):
"""
List org inner pub repos, which can be access by all org members.
"""
try:
repos = seafserv_threaded_rpc.list_org_inner_pub_repos(org_id)
except SearpcError:
repos = []
# calculate repo's lastest modify time
for repo in repos:
try:
repo.latest_modify = get_commits(repo.id, 0, 1)[0].ctime
except:
repo.latest_modify = None
# sort repos by latest modify time
repos.sort(lambda x, y: cmp(y.latest_modify, x.latest_modify))
return repos
def get_org_id_by_repo_id(repo_id):
"""
Get org id according repo id.