Skip to content

Commit

Permalink
update check_file_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
inflac committed Apr 27, 2024
1 parent b11f848 commit c942749
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion html/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
app.config['SESSION_COOKIE_HTTPONLY'] = True
app.config['SESSION_COOKIE_SAMESITE'] = 'lax'


oauth = OAuth(app)
github = oauth.register(
name='github',
Expand Down
3 changes: 0 additions & 3 deletions html/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,4 @@ def get_file_path(base_dir:str, file_name:str):
if file_path.count(".") > 1:
return False

if not os.path.exists(file_path):
return False

return file_path
4 changes: 2 additions & 2 deletions html/queuehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
remove_file_from_queue, remove_file_from_uploads)
from filehandler import move_file
from emailhandler import sent_email_error_message
from helper import logging, hash_sha_512, check_path_valid
from helper import logging, hash_sha_512

def approve_file(file_name, uploads_path:str, file_password:str, admin=False):
"""
Expand All @@ -33,7 +33,7 @@ def approve_file(file_name, uploads_path:str, file_password:str, admin=False):
logging("No db entry for requested file, nothing approved")
return False

if not check_path_valid(file_path):
if not os.path.exists(file_path):
logging(f"The requested file does not exist: {file_path}, "
"but a database entry for the file exists.")
error_message = ("While trying to approve a file, a database inconsistency was detected. "
Expand Down

0 comments on commit c942749

Please sign in to comment.