mirror of https://github.com/jumpserver/jumpserver
修改bug
parent
a8ce9e9952
commit
736c58ce05
|
@ -30,11 +30,11 @@ def perm_add(request):
|
|||
|
||||
else:
|
||||
username = request.POST.get('username', None)
|
||||
host_ips = request.POST.getlist('host_ips', None)
|
||||
host_ids = request.POST.getlist('host_ids', None)
|
||||
|
||||
user = User.objects.get(username=username)
|
||||
for ip in host_ips:
|
||||
asset = Asset.objects.get(ip=ip)
|
||||
for id in host_ids:
|
||||
asset = Asset.objects.get(id=id)
|
||||
perm = Permission(user=user, asset=asset)
|
||||
perm.save()
|
||||
msg = u'添加成功'
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<select id="host_ips" name="host_ips" multiple style="width: 100%">
|
||||
<select id="host_ids" name="host_ids" multiple style="width: 100%">
|
||||
{% for host in hosts %}
|
||||
<option value="{{ host.id }}">{{ host.ip }}</option>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Reference in New Issue