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:
9
utils.py
9
utils.py
@@ -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)
|
||||
|
Reference in New Issue
Block a user