From f06f2118c50689636960acab90ae9dd80ba96345 Mon Sep 17 00:00:00 2001 From: nitely Date: Wed, 31 Jan 2018 04:09:01 -0300 Subject: [PATCH] fix "no module named magic" error --- spirit/comment/forms.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/spirit/comment/forms.py b/spirit/comment/forms.py index 56c527677..efe60cac0 100644 --- a/spirit/comment/forms.py +++ b/spirit/comment/forms.py @@ -26,10 +26,11 @@ 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