Skip to content

Commit

Permalink
moves user valadation to check
Browse files Browse the repository at this point in the history
  • Loading branch information
nogoodidea committed Feb 27, 2024
1 parent e754087 commit 4f5753a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions proxstar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -613,7 +614,6 @@ def create():
username = user.name
else:
usage_check = None
username = request.form['user']
if usage_check:
return usage_check
else:
Expand Down Expand Up @@ -646,7 +646,6 @@ def create():
)
return '', 200
return '', 200
return None
else:
return '', 403

Expand Down

0 comments on commit 4f5753a

Please sign in to comment.