mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-09 19:01:42 +00:00
Add sending log message in file_view
This commit is contained in:
@@ -20,7 +20,7 @@ from django.utils.hashcompat import md5_constructor
|
|||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
from seaserv import list_dir_by_path, get_repo, web_get_access_token, \
|
from seaserv import list_dir_by_path, get_repo, web_get_access_token, \
|
||||||
get_commits, is_passwd_set, check_permission, get_shared_groups_by_repo,\
|
get_commits, is_passwd_set, check_permission, get_shared_groups_by_repo,\
|
||||||
is_group_user, get_file_id_by_path, get_commit
|
is_group_user, get_file_id_by_path, get_commit, send_message
|
||||||
from pysearpc import SearpcError
|
from pysearpc import SearpcError
|
||||||
|
|
||||||
from base.decorators import ctx_switch_required, repo_passwd_set_required
|
from base.decorators import ctx_switch_required, repo_passwd_set_required
|
||||||
@@ -331,6 +331,9 @@ def view_file(request, repo_id):
|
|||||||
org_id = request.user.org['org_id']
|
org_id = request.user.org['org_id']
|
||||||
is_starred = is_file_starred(username, repo.id, path.encode('utf-8'), org_id)
|
is_starred = is_file_starred(username, repo.id, path.encode('utf-8'), org_id)
|
||||||
|
|
||||||
|
# send logging message
|
||||||
|
send_message('seahub.stats', 'view-file\t%s\t%s' % (repo.id, obj_id))
|
||||||
|
|
||||||
template = 'view_file_%s.html' % ret_dict['filetype'].lower()
|
template = 'view_file_%s.html' % ret_dict['filetype'].lower()
|
||||||
return render_to_response(template, {
|
return render_to_response(template, {
|
||||||
'repo': repo,
|
'repo': repo,
|
||||||
|
Reference in New Issue
Block a user