From df06ff8725f942be1d46e71bf64ba1755823c82a Mon Sep 17 00:00:00 2001 From: Juda Kaleta Date: Tue, 20 Aug 2013 11:12:37 +0200 Subject: [PATCH] Release 0.3 --- CHANGES.rst | 26 ++++++++++++++++++++++++++ embed_video/base.py | 5 ++++- setup.py | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index e98cf67..b32ef96 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,32 @@ Changes ******* +0.3 +------ + +- Security fix: faked urls are treated as invalid. See `this page + `_ + for more details. + +- Fixes: + + - allow of empty video field. + + - requirements in setup.py + +- Added simplier way to embed video in one-line template tag:: + + {{ 'http://www.youtube.com/watch?v=guXyvo2FfLs'|embed:'large' }} + +- ``backend`` variable in ``video`` template tag. + + Usage:: + + {% video item.video as my_video %} + Backend: {{ my_video.backend }} + {% endvideo %} + + 0.2 ----- diff --git a/embed_video/base.py b/embed_video/base.py index 788d3b5..002dfb4 100644 --- a/embed_video/base.py +++ b/embed_video/base.py @@ -67,7 +67,10 @@ def get_code(self): if not code: parse_data = urlparse.urlparse(self._url) - code = urlparse.parse_qs(parse_data.query)['v'][0] + try: + code = urlparse.parse_qs(parse_data.query)['v'][0] + except KeyError: + raise UnknownIdException return code diff --git a/setup.py b/setup.py index a8e3a2e..b98f947 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(fname): setup( name='django-embed-video', packages=find_packages(), - version='0.2.0', + version='0.3', author='Juda Kaleta', author_email='juda.kaleta@gmail.com', url='https://github.com/yetty/django-embed-video',