Commit fe47b4ad authored by Seb's avatar Seb
Browse files

Added travis and tox configs, fixed error found with wagtail 1.4

parent 9b5b8662
......@@ -4,3 +4,4 @@ dist/
./settings.py
venv/
tests.sqlite3
.tox
language: python
cache: pip
# Matrix of build options
python:
- '3.4'
- '3.5'
env:
global:
- DJANGO_SETTINGS_MODULE="tests.app.settings"
- TOX_ENV=
matrix:
- DJANGO='18'
- DJANGO='19'
- WAGTAIL='14'
- WAGTAIL='15'
install:
- pip install --upgrade pip wheel tox
cache:
directories:
- $HOME/.cache/pip
- $HOME/virtualenv
script:
# Run tox using either a specific environment from TOX_ENV,
# or building one from the environment variables
- tox -e "${TOX_ENV:-py${TRAVIS_PYTHON_VERSION/./}-dj${DJANGO}-wt${WAGTAIL}}"
[tox]
skip_missing_interpreters = True
envlist =
py{34,35}-dj{18,19}-wt{14,15}
[testenv]
commands=python runtests.py
usedevelop = True
pip_pre = True
basepython =
py34: python3.4
py35: python3.5
deps =
dj18: Django~=1.8.0
dj19: Django~=1.9.0
wt14: wagtail~=1.4.0
wt15: wagtail~=1.5.0
......@@ -9,6 +9,7 @@ from wagtail.wagtailadmin.utils import PermissionPolicyChecker
from wagtail.wagtailcore.models import Collection
from wagtail.wagtailsearch import index as search_index
from wagtail.wagtailsearch.backends import get_search_backends
from wagtailvideos.forms import get_video_form
from wagtailvideos.models import Video
from wagtailvideos.permissions import permission_policy
......@@ -114,7 +115,12 @@ def chooser_upload(request):
video.save()
# Reindex the video to make sure all tags are indexed
search_index.insert_or_update_object(video)
from wagtail.wagtailcore import __version__
if __version__.startswith("1.4"):
for backend in get_search_backends():
backend.add(video)
else:
search_index.insert_or_update_object(video)
return render_modal_workflow(
request, None, 'wagtailvideos/chooser/video_chosen.js',
......
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