mirror of https://github.com/jumpserver/jumpserver
hehe
parent
3c1af0e266
commit
2e254af935
|
@ -448,7 +448,7 @@ def idc_edit(request):
|
||||||
i = IDC.objects.get(name='默认')
|
i = IDC.objects.get(name='默认')
|
||||||
Asset.objects.filter(id=host).update(idc=i)
|
Asset.objects.filter(id=host).update(idc=i)
|
||||||
|
|
||||||
return HttpResponseRedirect('/jasset/idc_detail/?id=%s' % idc_id)
|
return HttpResponseRedirect('/jasset/idc_list/' % idc_id)
|
||||||
|
|
||||||
return render_to_response('jasset/idc_add.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('jasset/idc_add.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|
|
@ -370,6 +370,7 @@ def get_connect_item(username, ip):
|
||||||
def validate(request, user_group=None, user=None, asset_group=None, asset=None, edept=None):
|
def validate(request, user_group=None, user=None, asset_group=None, asset=None, edept=None):
|
||||||
dept = get_session_user_dept(request)[1]
|
dept = get_session_user_dept(request)[1]
|
||||||
if edept:
|
if edept:
|
||||||
|
print dept.name, edept[0], type(dept.name), type(edept[0])
|
||||||
if dept.name != edept[0]:
|
if dept.name != edept[0]:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -394,11 +395,11 @@ def validate(request, user_group=None, user=None, asset_group=None, asset=None,
|
||||||
dept_asset_groups = dept.bisgroup_set.all()
|
dept_asset_groups = dept.bisgroup_set.all()
|
||||||
asset_groups = []
|
asset_groups = []
|
||||||
for asset_group_name in dept_asset_groups:
|
for asset_group_name in dept_asset_groups:
|
||||||
asset_groups.extend(asset_group_name.name)
|
asset_groups.append(asset_group_name.name)
|
||||||
|
|
||||||
if len(asset_groups) == 0:
|
if len(asset_groups) == 0:
|
||||||
return False
|
return False
|
||||||
|
print asset_group, asset_groups
|
||||||
if not set(asset_group).issubset(set(asset_groups)):
|
if not set(asset_group).issubset(set(asset_groups)):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
url: "/jasset/group_del/multi/",
|
url: "/jasset/group_del/multi/",
|
||||||
data: {"id_list": id_list, "len_list": j},
|
data: {"id_list": id_list, "len_list": j},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
window.open("/jasset/jgroup_list/", "_self");
|
window.open("/jasset/group_list/", "_self");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue