Commit ee916b77 authored by Tim Heap's avatar Tim Heap
Browse files

Remove compatibility code for unsupported django, wagtail versions

parent 5b4a65c6
...@@ -227,10 +227,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model): ...@@ -227,10 +227,7 @@ class AbstractVideo(CollectionMember, index.Indexed, models.Model):
@classmethod @classmethod
def get_transcode_model(cls): def get_transcode_model(cls):
if django.VERSION >= (1, 9): return cls.transcodes.rel.related_model
return cls.transcodes.rel.related_model
else:
return cls.transcodes.related.related_model
def get_transcode(self, media_format): def get_transcode(self, media_format):
Transcode = self.get_transcode_model() Transcode = self.get_transcode_model()
......
...@@ -118,12 +118,7 @@ def chooser_upload(request): ...@@ -118,12 +118,7 @@ def chooser_upload(request):
video.save() video.save()
# Reindex the video to make sure all tags are indexed # Reindex the video to make sure all tags are indexed
from wagtail.wagtailcore import __version__ search_index.insert_or_update_object(video)
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( return render_modal_workflow(
request, None, 'wagtailvideos/chooser/video_chosen.js', 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