]> git.ipfire.org Git - ipfire.org.git/commitdiff
blog: Fix rendering feed when no author exists
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Aug 2018 08:04:02 +0000 (09:04 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 22 Aug 2018 08:04:02 +0000 (09:04 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/blog/feed.xml

index 69eaba3467e0170aa9063ec5062975a106412f56..82c239b46563ce0d9ce253712af2206830bbe706 100644 (file)
@@ -1,4 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
+
+{% import ipfire.accounts as accounts %}
+
 <rss version="2.0"
                xmlns:content="http://purl.org/rss/1.0/modules/content/"
                xmlns:atom="http://www.w3.org/2005/Atom"
                        <item>
                                <title>{{ post.title }}</title>
                                <link>https://blog.ipfire.org/post/{{ post.slug }}</link>
-                               <author>{{ post.author.email }} ({{ post.author.name }})</author>
+                               {% if isinstance(post.author, accounts.Account) %}
+                                       <author>{{ post.author.email }} ({{ post.author.name }})</author>
+                               {% else %}
+                                       <author>{{ post.author }}</author>
+                               {% end %}
                                <pubDate>{{ post.published_at.strftime("%a, %d %b %Y %H:%M:%S +0200") }}</pubDate>
                                <guid isPermaLink="false"></guid>
                                <description><![CDATA[{% raw post.html %}]]></description>