Work on temporary hosted files

This commit is contained in:
Scott Idem
2021-11-23 17:17:40 -05:00
parent 24c7411109
commit 523a7378c6
3 changed files with 13 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
from app.log import log, logging, logger_reset
from app.config import settings
from app.db_sql import redis_lookup_id_random, sql_select
@@ -114,7 +115,7 @@ def decode_jwt(
# ### BEGIN ### API Lib General ### create_export() ###
# Updated 2021-07-14
# Updated 2021-11-23
@logger_reset
def create_export_file(
data_dict_list: list,
@@ -125,10 +126,11 @@ def create_export_file(
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
hosted_temp_path = 'admin/temp'
log.info(f'Hosted Temp Path: {hosted_temp_path}')
hosted_tmp_path = settings.PATH_HOSTED_TMP_ROOT
# hosted_tmp_path = 'admin/temp'
log.info(f'Hosted Temp Path: {hosted_tmp_path}')
subdirectory_dest = os.path.join(hosted_temp_path, subdir_path)
subdirectory_dest = os.path.join(hosted_tmp_path, subdir_path)
log.debug(subdirectory_dest)
pathlib.Path(subdirectory_dest).mkdir(parents=True, exist_ok=True)
file_dest_w_subdir = os.path.join(subdirectory_dest, filename)
@@ -154,5 +156,4 @@ def create_export_file(
return False
return True
# ### END ### API Lib General ### create_export() ###