修改bug

pull/2/head
guanghongwei 2014-09-23 21:56:59 +08:00
parent a25b2df453
commit d4f40feebf
1 changed files with 4 additions and 2 deletions

View File

@ -264,7 +264,8 @@ def index(request):
@admin_required @admin_required
def showUser(request): def showUser(request):
"""查看所有用户""" """查看所有用户"""
info = ''
error = ''
if request.method == 'POST': if request.method == 'POST':
selected_user = request.REQUEST.getlist('selected') selected_user = request.REQUEST.getlist('selected')
if selected_user: if selected_user:
@ -290,6 +291,7 @@ def showUser(request):
if not error: if not error:
info = '用户删除成功' info = '用户删除成功'
return HttpResponseRedirect('/showUser/')
else: else:
if request.session.get('admin') == 2: if request.session.get('admin') == 2:
@ -297,7 +299,7 @@ def showUser(request):
elif request.session.get('admin') == 1: elif request.session.get('admin') == 1:
users = group_member(request.session.get('username')) users = group_member(request.session.get('username'))
return render_to_response( return render_to_response(
'showUser.html', 'showUser.html',
{'users': users, 'info': info, 'error': error, 'user_menu': 'active'}, {'users': users, 'info': info, 'error': error, 'user_menu': 'active'},
context_instance=RequestContext(request)) context_instance=RequestContext(request))