jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

expected string or buffer #24

Closed javierwilson closed 10 years ago

javierwilson commented 10 years ago

When using ListView.as_view {% video item.video 'small' %} I get: expected string or buffer in embed_video/backends.py in is_valid, line 144

It only works if I get the string value first, for example: {% video item.video|default_if_none:"" 'small' %}

yetty commented 10 years ago

It will be fixed in next version.

Better quickfix than using default_if_none is a simple condition:

{% if item.video %}
    {% video item.video 'small' %}
{% endif %}