修改group

pull/2/head
guanghongwei 2014-10-03 22:11:59 +08:00
parent c8444ef73a
commit bb0a023380
1 changed files with 3 additions and 1 deletions

View File

@ -526,7 +526,7 @@ def addGroup(request):
msg = '' msg = ''
if request.method == 'POST': if request.method == 'POST':
group_name = request.POST.get('name') group_name = request.POST.get('name')
if not group_name: if group_name:
group = Group(name=group_name) group = Group(name=group_name)
group.save() group.save()
msg = u'%s 属组添加成功' % group_name msg = u'%s 属组添加成功' % group_name
@ -539,6 +539,8 @@ def addGroup(request):
@superuser_required @superuser_required
def showGroup(request): def showGroup(request):
error = ''
msg = ''
groups = Group.objects.all() groups = Group.objects.all()
if request.method == 'POST': if request.method == 'POST':
selected_group = request.REQUEST.getlist('selected') selected_group = request.REQUEST.getlist('selected')