fix "no module named magic" error

This commit is contained in:
nitely 2018-01-31 04:09:01 -03:00
parent eaf745880f
commit f06f2118c5

View File

@ -26,10 +26,11 @@ try:
except ImportError as err:
# There used to be a logger.exception here but
# the traceback made things confusing when an unhandled was raised
logger.warning(
'Can\'t load python-magic. '
'Is libmagic installed?')
logger.error(err)
if settings.ST_UPLOAD_FILE_ENABLED:
logger.warning(
'Can\'t load python-magic. '
'Is libmagic installed?')
logger.error(err)
magic = None