1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

Add repo last modify time

This commit is contained in:
xiez
2012-06-28 16:58:09 +08:00
parent ad9ce0e10b
commit 05a4cc9d0a
6 changed files with 57 additions and 9 deletions

View File

@@ -7,6 +7,8 @@ from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.hashcompat import sha_constructor
from seaserv import get_commits
def go_permission_error(request, msg=None):
"""
Return permisson error page.
@@ -72,3 +74,16 @@ def validate_group_name(group_name):
"""
return re.match('^\w+$', group_name, re.U)
def calculate_repo_last_modify(repo_list):
"""
Get last modify time for repo.
"""
for repo in repo_list:
try:
repo.latest_modify = get_commits(repo.id, 0, 1)[0].ctime
except:
repo.latest_modify = None
continue