pass proper user for create usage, redirect properly after delete

This commit is contained in:
Jordan Rodgers 2017-12-12 15:58:56 -05:00
parent 539cd6f0f4
commit 3319fa6362
2 changed files with 2 additions and 2 deletions

2
app.py
View file

@ -261,7 +261,7 @@ def create():
app.config['STARRS_DB_NAME'], app.config['STARRS_DB_USER'], app.config['STARRS_DB_NAME'], app.config['STARRS_DB_USER'],
app.config['STARRS_DB_HOST'], app.config['STARRS_DB_PASS']) app.config['STARRS_DB_HOST'], app.config['STARRS_DB_PASS'])
if request.method == 'GET': if request.method == 'GET':
usage = get_user_usage(proxmox, 'proxstar') usage = get_user_usage(proxmox, user)
limits = get_user_usage_limits(user) limits = get_user_usage_limits(user)
percents = get_user_usage_percent(proxmox, usage, limits) percents = get_user_usage_percent(proxmox, usage, limits)
isos = get_isos(proxmox, app.config['PROXMOX_ISO_STORAGE']) isos = get_isos(proxmox, app.config['PROXMOX_ISO_STORAGE'])

View file

@ -24,7 +24,7 @@ $("#delete-vm").click(function(){
icon: "success", icon: "success",
}); });
}).then(() => { }).then(() => {
window.location = ""; window.location = "/";
}).catch(err => { }).catch(err => {
if (err) { if (err) {
swal("Uh oh...", `Unable to delete ${vmname}. Please try again later.`, "error"); swal("Uh oh...", `Unable to delete ${vmname}. Please try again later.`, "error");