Commit f5e57da1 authored by Jiajun Liu's avatar Jiajun Liu

fix line break bug on add multiple hosts

parent b8dfb26a
...@@ -232,7 +232,7 @@ def host_add_batch(request): ...@@ -232,7 +232,7 @@ def host_add_batch(request):
active_types = {'激活': 1, '禁用': 0} active_types = {'激活': 1, '禁用': 0}
dept_id = get_user_dept(request) dept_id = get_user_dept(request)
if request.method == 'POST': if request.method == 'POST':
multi_hosts = request.POST.get('j_multi').split('\n') multi_hosts = request.POST.get('j_multi').splitlines()
for host in multi_hosts: for host in multi_hosts:
if host == '': if host == '':
break break
...@@ -927,4 +927,4 @@ def host_search(request): ...@@ -927,4 +927,4 @@ def host_search(request):
posts = list(set(post_all) & set(post_perm)) posts = list(set(post_all) & set(post_perm))
contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request) contact_list, p, contacts, page_range, current_page, show_first, show_end = pages(posts, request)
return my_render('jasset/host_search.html', locals(), request) return my_render('jasset/host_search.html', locals(), request)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment