Commit e297936f authored by seb-b's avatar seb-b Committed by GitHub
Browse files

Merge pull request #15 from takeflight/remove-compat-code

Remove compatibility code for unsupported django, wagtail versions
parents 5b4a65c6 ee916b77
......@@ -227,10 +227,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model):
@classmethod
def get_transcode_model(cls):
if django.VERSION >= (1, 9):
return cls.transcodes.rel.related_model
else:
return cls.transcodes.related.related_model
return cls.transcodes.rel.related_model
def get_transcode(self, media_format):
Transcode = self.get_transcode_model()
......
......@@ -118,12 +118,7 @@ def chooser_upload(request):
video.save()
# Reindex the video to make sure all tags are indexed
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)
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