fix user can not get login logs bug

pull/12/head
Jiajun Liu 2015-07-07 16:51:54 +08:00
parent 19343540b9
commit 627d627995
1 changed files with 3 additions and 3 deletions

View File

@ -812,8 +812,8 @@ def user_detail(request):
if user:
user = user[0]
asset_group_permed = user_perm_group_api(user)
logs_last = Log.objects.filter(user=user.name).order_by('-start_time')[0:10]
logs_all = Log.objects.filter(user=user.name).order_by('-start_time')
logs_last = Log.objects.filter(user=user.username).order_by('-start_time')[0:10]
logs_all = Log.objects.filter(user=user.username).order_by('-start_time')
logs_num = len(logs_all)
return render_to_response('juser/user_detail.html', locals(), context_instance=RequestContext(request))
@ -1053,4 +1053,4 @@ def down_key(request):
response['Content-Disposition'] = 'attachment; filename=%s' % os.path.basename(private_key_file)
return response
return HttpResponse('No Key File. Contact Admin.')
return HttpResponse('No Key File. Contact Admin.')