|
|
@ -596,12 +596,11 @@ def chgGroup(request):
|
|
|
|
error = ''
|
|
|
|
error = ''
|
|
|
|
msg = ''
|
|
|
|
msg = ''
|
|
|
|
if request.method == 'GET':
|
|
|
|
if request.method == 'GET':
|
|
|
|
group_id = request.GET.filter('id')
|
|
|
|
group_id = request.GET.filter('id', None)
|
|
|
|
if group_id:
|
|
|
|
if group_id:
|
|
|
|
group_id = group_id[0]
|
|
|
|
group = Group.objects.get(id=group_id)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
return HttpResponseRedirect('/showGroup/')
|
|
|
|
return HttpResponseRedirect('/showGroup/')
|
|
|
|
group = Group.objects.get(id=group_id)
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
group_id = request.POST.get('id')
|
|
|
|
group_id = request.POST.get('id')
|
|
|
|
group_name = request.POST.get('name')
|
|
|
|
group_name = request.POST.get('name')
|
|
|
@ -643,12 +642,11 @@ def chgIDC(request):
|
|
|
|
error = ''
|
|
|
|
error = ''
|
|
|
|
msg = ''
|
|
|
|
msg = ''
|
|
|
|
if request.method == 'GET':
|
|
|
|
if request.method == 'GET':
|
|
|
|
idc_id = request.GET.filter('id')
|
|
|
|
idc_id = request.GET.get('id', None)
|
|
|
|
if idc_id:
|
|
|
|
if not idc_id:
|
|
|
|
idc_id = idc_id[0]
|
|
|
|
|
|
|
|
idc = Group.objects.get(id=idc_id)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
return HttpResponseRedirect('/showIDC/')
|
|
|
|
return HttpResponseRedirect('/showIDC/')
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
idc = IDC.objects.get(id=idc_id)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
idc_id = request.POST.get('id')
|
|
|
|
idc_id = request.POST.get('id')
|
|
|
|
idc_name = request.POST.get('name')
|
|
|
|
idc_name = request.POST.get('name')
|
|
|
@ -661,7 +659,7 @@ def chgIDC(request):
|
|
|
|
idc.save()
|
|
|
|
idc.save()
|
|
|
|
msg = u'修改成功'
|
|
|
|
msg = u'修改成功'
|
|
|
|
|
|
|
|
|
|
|
|
return render_to_response('chgGroup.html', {'group': idc, 'error': error, 'msg': msg, 'asset_menu': 'active'},
|
|
|
|
return render_to_response('chgGroup.html', {'idc': idc, 'error': error, 'msg': msg, 'asset_menu': 'active'},
|
|
|
|
context_instance=RequestContext(request))
|
|
|
|
context_instance=RequestContext(request))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|