Strip out deleted VMs before passing them to shell scripts

This commit is contained in:
j3s 2020-05-20 18:37:53 -05:00
parent 773aa78ac4
commit e3f4de214c
1 changed files with 2 additions and 2 deletions

View File

@ -44,6 +44,7 @@ def double_check_capsul_address(id, ipv4):
@account_required
def index():
vms = get_vms()
vms = list(filter(lambda x: not x['deleted'], vms))
created = request.args.get('created')
# this is here to prevent xss
@ -63,8 +64,7 @@ def index():
ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"),
os=x['os'],
created=x['created'].strftime("%b %d %Y")
),
list(filter(lambda x: not x['deleted'], vms))
), vms
))
return render_template("capsuls.html", vms=vms, has_vms=len(vms) > 0, created=created)