mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
moves user valadation to check
This commit is contained in:
parent
e754087285
commit
4f5753aec5
1 changed files with 2 additions and 3 deletions
|
@ -593,8 +593,9 @@ def create():
|
|||
cores = request.form['cores']
|
||||
memory = request.form['mem']
|
||||
disk = request.form['disk']
|
||||
username = request.form['user']
|
||||
## 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 or user == '':
|
||||
return (
|
||||
'VM creation with cores and/or mem and/or disk values that are less than 0',
|
||||
400,
|
||||
|
@ -613,7 +614,6 @@ def create():
|
|||
username = user.name
|
||||
else:
|
||||
usage_check = None
|
||||
username = request.form['user']
|
||||
if usage_check:
|
||||
return usage_check
|
||||
else:
|
||||
|
@ -646,7 +646,6 @@ def create():
|
|||
)
|
||||
return '', 200
|
||||
return '', 200
|
||||
return None
|
||||
else:
|
||||
return '', 403
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue