Deleted redundant const

This commit is contained in:
Shay Nehmad 2020-07-20 16:04:27 +03:00
parent 832662602d
commit 844b2f1e2a
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import flask_restful import flask_restful
from flask import send_from_directory from flask import send_from_directory
from monkey_island.cc.resources.pba_file_upload import GET_FILE_DIR
from monkey_island.cc.services.post_breach_files import UPLOADS_DIR
__author__ = 'VakarisZ' __author__ = 'VakarisZ'
@ -12,4 +13,4 @@ class PBAFileDownload(flask_restful.Resource):
# Used by monkey. can't secure. # Used by monkey. can't secure.
def get(self, path): def get(self, path):
return send_from_directory(GET_FILE_DIR, path) return send_from_directory(UPLOADS_DIR, path)

View File

@ -11,7 +11,6 @@ import copy
__author__ = 'VakarisZ' __author__ = 'VakarisZ'
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
GET_FILE_DIR = "./userUploads"
# Front end uses these strings to identify which files to work with (linux of windows) # Front end uses these strings to identify which files to work with (linux of windows)
LINUX_PBA_TYPE = 'PBAlinux' LINUX_PBA_TYPE = 'PBAlinux'
WINDOWS_PBA_TYPE = 'PBAwindows' WINDOWS_PBA_TYPE = 'PBAwindows'
@ -37,7 +36,7 @@ class FileUpload(flask_restful.Resource):
filename = ConfigService.get_config_value(copy.deepcopy(PBA_LINUX_FILENAME_PATH)) filename = ConfigService.get_config_value(copy.deepcopy(PBA_LINUX_FILENAME_PATH))
else: else:
filename = ConfigService.get_config_value(copy.deepcopy(PBA_WINDOWS_FILENAME_PATH)) filename = ConfigService.get_config_value(copy.deepcopy(PBA_WINDOWS_FILENAME_PATH))
return send_from_directory(GET_FILE_DIR, filename) return send_from_directory(UPLOADS_DIR, filename)
@jwt_required() @jwt_required()
def post(self, file_type): def post(self, file_type):