Validate the temporary directory in the post init of the common app

This commit is contained in:
Roberto Rosario
2012-09-22 03:02:33 -04:00
parent 47ac12b4d1
commit 37f79ffde3
2 changed files with 11 additions and 5 deletions

11
apps/common/post_init.py Normal file
View 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())