Validate the temporary directory in the post init of the common app
This commit is contained in:
11
apps/common/post_init.py
Normal file
11
apps/common/post_init.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import tempfile
|
||||
|
||||
from .utils import validate_path
|
||||
import common.settings as common_settings
|
||||
|
||||
|
||||
def init_validate_temp_path():
|
||||
if (validate_path(common_settings.TEMPORARY_DIRECTORY) == False) or (not common_settings.TEMPORARY_DIRECTORY):
|
||||
setattr(common_settings, 'TEMPORARY_DIRECTORY', tempfile.mkdtemp())
|
||||
Reference in New Issue
Block a user