forked from 3wordchant/capsul-flask
Strip out deleted VMs before passing them to shell scripts
This commit is contained in:
parent
773aa78ac4
commit
e3f4de214c
@ -44,6 +44,7 @@ def double_check_capsul_address(id, ipv4):
|
|||||||
@account_required
|
@account_required
|
||||||
def index():
|
def index():
|
||||||
vms = get_vms()
|
vms = get_vms()
|
||||||
|
vms = list(filter(lambda x: not x['deleted'], vms))
|
||||||
created = request.args.get('created')
|
created = request.args.get('created')
|
||||||
|
|
||||||
# this is here to prevent xss
|
# this is here to prevent xss
|
||||||
@ -63,8 +64,7 @@ def index():
|
|||||||
ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"),
|
ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"),
|
||||||
os=x['os'],
|
os=x['os'],
|
||||||
created=x['created'].strftime("%b %d %Y")
|
created=x['created'].strftime("%b %d %Y")
|
||||||
),
|
), vms
|
||||||
list(filter(lambda x: not x['deleted'], vms))
|
|
||||||
))
|
))
|
||||||
|
|
||||||
return render_template("capsuls.html", vms=vms, has_vms=len(vms) > 0, created=created)
|
return render_template("capsuls.html", vms=vms, has_vms=len(vms) > 0, created=created)
|
||||||
|
Loading…
Reference in New Issue
Block a user