recall how python if statements work

This commit is contained in:
nogoodidea 2024-02-26 19:34:50 -05:00
parent 8e1b0a88d0
commit 86abbf59c3

View file

@ -413,7 +413,7 @@ def vm_renew(vmid):
@auth.oidc_auth @auth.oidc_auth
def create_disk(vmid, size): def create_disk(vmid, size):
## are they trying to disk with zero size ## are they trying to disk with zero size
if(size =< 0): if size <= 0:
return '', 400 return '', 400
user = User(session['userinfo']['preferred_username']) user = User(session['userinfo']['preferred_username'])
connect_proxmox() connect_proxmox()
@ -594,7 +594,7 @@ def create():
memory = request.form['mem'] memory = request.form['mem']
disk = request.form['disk'] disk = request.form['disk']
## CHECK STUFF DEAR GOD ## CHECK STUFF DEAR GOD
if(int(cores) <= 0 or int(memory) <= 0 or int(disk) <= 0){ if int(cores) <= 0 or int(memory) <= 0 or int(disk) <= 0{
return 'VM creation with cores and/or mem and/or disk values that are less than 0' 400 return 'VM creation with cores and/or mem and/or disk values that are less than 0' 400
} }