Create the media folder if is doesn't exist.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2018-04-28 23:16:13 -04:00
parent 78961bec49
commit 018c641e8b

View File

@@ -1,7 +1,9 @@
from __future__ import absolute_import, unicode_literals
from datetime import timedelta
import errno
import logging
import os
import warnings
from kombu import Exchange, Queue
@@ -92,6 +94,15 @@ class CommonApp(MayanAppConfig):
if check_for_sqlite():
warnings.warn(force_text(MESSAGE_SQLITE_WARNING))
# Create the media folder
if not os.path.exists(settings.MEDIA_ROOT):
# Create the media folder
try:
os.makedirs(settings.MEDIA_ROOT)
except OSError as exception:
if exception.errno == errno.EEXIST:
pass
app.conf.CELERYBEAT_SCHEDULE.update(
{
'task_delete_stale_uploads': {