Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
inflac authored Apr 18, 2024
1 parent 459301e commit 7f8ccb9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions html/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,14 @@ def management_update_upload_limit():

if not check_access(session['user_name'], 9):
return render_template('errors/error.html', error_message=f"You aren't allowed to access this page")


upload_limit = sanitize_string(request.form['upload_limit'])
target_user_name = sanitize_string(request.form['target_user_name'])
if len(upload_limit) > 31 or len(target_user_name) > 100:
return render_template('errors/error.html', error_message=f"Specified parameters are too large")

try:
upload_limit = int(sanitize_string(request.form['upload_limit']))
target_user_name = sanitize_string(request.form['target_user_name'])
upload_limit = int(upload_limit)
except (KeyError, ValueError) as e:
return render_template('errors/error.html', error_message=f"Specified upload limit isn't valid")

Expand Down

0 comments on commit 7f8ccb9

Please sign in to comment.