mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
split into 2 functions
This commit is contained in:
parent
4f5753aec5
commit
1ca123b612
1 changed files with 79 additions and 72 deletions
|
@ -566,13 +566,12 @@ def set_boot_order(vmid):
|
|||
return '', 403
|
||||
|
||||
|
||||
@app.route('/vm/create', methods=['GET', 'POST'])
|
||||
@app.route('/vm/create', methods=['GET'])
|
||||
@auth.oidc_auth
|
||||
def create():
|
||||
def get_create():
|
||||
user = User(session['userinfo']['preferred_username'])
|
||||
proxmox = connect_proxmox()
|
||||
if user.active or user.rtp:
|
||||
if request.method == 'GET':
|
||||
stored_isos = get_isos(proxmox, app.config['PROXMOX_ISO_STORAGE'])
|
||||
pools = get_pools(proxmox, db)
|
||||
for pool in get_shared_pools(db, user.name, True):
|
||||
|
@ -588,7 +587,15 @@ def create():
|
|||
pools=pools,
|
||||
templates=templates,
|
||||
)
|
||||
elif request.method == 'POST':
|
||||
else:
|
||||
return '', 403
|
||||
|
||||
|
||||
@app.route('/vm/create', methods=['POST'])
|
||||
@auth.oidc_auth
|
||||
def create():
|
||||
user = User(session['userinfo']['preferred_username'])
|
||||
if user.active or user.rtp:
|
||||
name = request.form['name'].lower()
|
||||
cores = request.form['cores']
|
||||
memory = request.form['mem']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue