AlphacrucisCollege / django-template-utils

Fork of (abandoned?) package used in ac.edu.au. Exported via GoogleCodeExport.
https://bitbucket.org/ubernostrum/django-template-utils
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

If no number are specified, then it fails to include_feed #21

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If I do this, it fails : 

{% include_feed "http://feeds.feedburner.com/UnELectronLibre" 
feeds_include/feed_blog.html %}

as int is expecting a number or a string but not a NoneType.

I changed line 28 of feeds.py as follow (maybe improved, I'm new to python) :

        if self.num_items is None:
            num_items = len(feed['entries'])
        else:
            num_items = int(self.num_items)

instead of num_items = int(self.num_items) or len(feed['entries'])

Indeed, it no numbers are given, then the int() fail

Under standard version of Python in Mac OSX Leopard (2.5.1)

Original issue reported on code.google.com by nsteinm...@gmail.com on 13 Mar 2009 at 11:34