Create the media folder if is doesn't exist.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -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': {
|
||||
|
||||
Reference in New Issue
Block a user