diff --git a/proxstar/__init__.py b/proxstar/__init__.py index 5d5e1a6..43b1803 100644 --- a/proxstar/__init__.py +++ b/proxstar/__init__.py @@ -485,16 +485,13 @@ def create(): if iso != 'none': iso = '{}:iso/{}'.format(app.config['PROXMOX_ISO_STORAGE'], iso) if not user.rtp: - if template == 'none': - usage_check = user.check_usage(0, 0, disk) - else: - usage_check = user.check_usage(cores, memory, disk) + usage_check = user.check_usage(cores, memory, disk) username = user.name else: usage_check = None username = request.form['user'] if usage_check: - return usage_check + return usage_check, 403 else: valid, available = ( check_hostname(starrs, name) if app.config['USE_STARRS'] else (True, True) diff --git a/proxstar/static/js/script.js b/proxstar/static/js/script.js index 53bd1cd..adb8392 100644 --- a/proxstar/static/js/script.js +++ b/proxstar/static/js/script.js @@ -284,9 +284,9 @@ $("#create-vm").click(function(){ swal("Uh oh...", "Invalid SSH key!", "error"); } else if (disk > max_disk) { swal("Uh oh...", `You do not have enough disk resources available! Please lower the VM disk size to ${max_disk}GB or lower.`, "error"); - } else if (template != 'none' && cores > max_cpu) { + } else if (cores > max_cpu) { swal("Uh oh...", `You do not have enough CPU resources available! Please lower the VM cores to ${max_cpu} or lower.`, "error"); - } else if (template != 'none' && mem/1024 > max_mem) { + } else if (mem/1024 > max_mem) { swal("Uh oh...", `You do not have enough memory resources available! Please lower the VM memory to ${max_mem}GB or lower.`, "error"); } else { fetch(`/hostname/${name}`, {