1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

Add group management, and modify repo download link

This commit is contained in:
xiez
2012-05-16 14:10:54 +08:00
parent edb5ae0744
commit 91dbc381f4
7 changed files with 127 additions and 34 deletions

View File

@@ -7,6 +7,7 @@ from django.template import RequestContext
from django.utils.hashcompat import sha_constructor
import time
import re
import settings
def go_permission_error(request, msg=None):
@@ -71,3 +72,11 @@ def gen_token():
token = sha_constructor(settings.SECRET_KEY + unicode(time.time())).hexdigest()[::8]
return token
def validate_group_name(group_name):
"""
Check whether group name is valid.
A valid group name only contains alphanumeric character
"""
return re.match('^\w+$', group_name, re.U)