fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further changes in i18n.
[wolnelektury.git]
/
apps
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/apps/catalogue/templatetags/catalogue_tags.py
b/apps/catalogue/templatetags/catalogue_tags.py
index
3c34e8c
..
41be051
100644
(file)
--- a/
apps/catalogue/templatetags/catalogue_tags.py
+++ b/
apps/catalogue/templatetags/catalogue_tags.py
@@
-1,4
+1,10
@@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+import feedparser
+import datetime
+
from django import template
from django.template import Node, Variable
from django.utils.encoding import smart_str
from django import template
from django.template import Node, Variable
from django.utils.encoding import smart_str
@@
-190,12
+196,9
@@
class CatalogueURLNode(Node):
@register.inclusion_tag('catalogue/latest_blog_posts.html')
@register.inclusion_tag('catalogue/latest_blog_posts.html')
-def latest_blog_posts(feed_url, posts_to_show=5):
- import feedparser
- import datetime
-
+def latest_blog_posts(feed_url, posts_to_show=5):
try:
try:
- feed = feedparser.parse(
feed_url
)
+ feed = feedparser.parse(
str(feed_url)
)
posts = []
for i in range(posts_to_show):
pub_date = feed['entries'][i].updated_parsed
posts = []
for i in range(posts_to_show):
pub_date = feed['entries'][i].updated_parsed