Commit 69785b13 authored by Seb's avatar Seb
Browse files

Changed ffmpeg check to warning intead of error

parent ef5f2449
from __future__ import absolute_import, print_function, unicode_literals
from django.apps import AppConfig
from django.core.checks import Error, register
from django.core.checks import Warning, register
from wagtailvideos.utils import which
from wagtailvideos.utils import ffmpeg_installed
def ffmpeg_check(app_configs, path=None, **kwargs):
errors = []
if which('ffmpeg', path=path) is None:
errors.append(
Error(
'ffmpeg could not be found on your system, try installing it.',
messages = []
if not ffmpeg_installed(path=path):
messages.append(
Warning(
'ffmpeg could not be found on your system. Transcoding will be disabled',
hint=None,
obj='SystemCheckError',
id='wagtailvideos.E001',
id='wagtailvideos.W001',
)
)
return errors
return messages
class WagtailVideosApp(AppConfig):
......
......@@ -4,3 +4,9 @@ try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which
def ffmpeg_installed(path=None):
if which('ffmpeg', path=path) is None:
return False
return True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment