handle no epub in opds
[wolnelektury.git] / apps / opds / views.py
index 4f1bec0..09aaa54 100644 (file)
@@ -185,10 +185,10 @@ class AcquisitionFeed(Feed):
             return u''
 
     def item_enclosure_url(self, book):
-        return full_url(book.epub_file.url)
+        return full_url(book.epub_file.url) if book.epub_file else None
 
     def item_enclosure_length(self, book):
-        return book.epub_file.size
+        return book.epub_file.size if book.epub_file else None
 
 @piwik_track
 class RootFeed(Feed):