diff --git a/app/network/views.py b/app/network/views.py index bad768cdb656eb6e44ba7173818338eb022b58e3..168ac94a3aa16fea336eee3aecb03d771c7fcd88 100644 --- a/app/network/views.py +++ b/app/network/views.py @@ -90,12 +90,13 @@ def view_host(name): if form.validate_on_submit(): if not current_user.is_admin: flash(f'Only admin users are allowed to create a VM!', 'info') + return redirect(url_for('network.view_host', name=name)) else: interface = host.interfaces[0] task = tasks.trigger_vm_creation(name, interface, int(form.memory.data) * 1000, form.cores.data) current_app.logger.info(f'Creation of {name} requested: task {task.id}') - flash(f'Creation of {name} requested!', 'success') - return redirect(url_for('network.view_host', name=name)) + flash(f'Creation of {name} requested! Refresh the page to update the status.', 'success') + return redirect(url_for('task.view_task', id_=task.id)) return render_template('network/view_host.html', host=host, form=form)