Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
honglei5181 committed May 11, 2016
1 parent e0b66cf commit 5bdcacf
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions groups/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,11 @@ def manage_host(request,*args,**kw):

@login_required(login_url="/account/login/")
def del_host(request):
<<<<<<< HEAD
_success=False
_error=False
_ids=request.POST.getlist("id")
_minion_ids=[]
#try:
if 1:
try:
_filter=Hosts.objects.filter(id__in=_ids)
for _m in _filter:
_minion_ids.append(_m.minion.id)
Expand All @@ -157,32 +155,10 @@ def del_host(request):
#delete hosts
_filter.delete()
_success="Delete opearation success!"
#except Exception as e:
else:
except Exception as e:
_error="Delete opearation error!"

return manage_host(request,success=_success,error=_error)
=======
_success=False
_error=False
_ids=request.POST.getlist("id")
_minion_ids=[]
try:
_filter=Hosts.objects.filter(id__in=_ids)
for _m in _filter:
_minion_ids.append(_m.minion.id)
#delete minion_status
_m_filter = Minions_status.objects.filter(id__in=_minion_ids)
_m_filter.delete()
#delete hosts
_filter.delete()
_success="Delete opearation success!"
except Exception as e:
_error="Delete opearation error!"



>>>>>>> saltshaker-dev
@login_required(login_url="/account/login/")
def modify_host(request):
_success=False
Expand Down

0 comments on commit 5bdcacf

Please sign in to comment.