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

Fix string formating #23

Closed szuliq closed 10 years ago

szuliq commented 10 years ago

There is a lot of spaces in this error message.

By the way, this is never raised in normal condition. The detect_backend doesn't try to get_code() at all.

yetty commented 10 years ago

You are right, it cannot be raised. It is a historical artefact, after refactoring of VideoBackend.__init__ it lost sense. Don't you want to remove it all directly? Together with the test EmbedVideoFormFieldTestCase.test_validation_unknownid [1].

[1] https://github.com/yetty/django-embed-video/blob/master/embed_video/tests/tests_fields.py#L36

szuliq commented 10 years ago

Personally I do call get_code() in is_valid() and I think catching it and raising ValidationError is a perfectly valid case.

yetty commented 10 years ago

Ok.