From 419220c6c924517056d4a9dcf7a01c8cf632b4c0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 14 Jun 2022 10:41:02 +0200 Subject: [PATCH] Fixed broken RSS feed URL when no articles are present --- madblog/routes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/madblog/routes.py b/madblog/routes.py index 676021d..55b6cf1 100644 --- a/madblog/routes.py +++ b/madblog/routes.py @@ -101,7 +101,10 @@ def rss_route(): link=config.link, categories=','.join(config.categories), language=config.language, - last_pub_date=pages[0][1]['published'].strftime('%a, %d %b %Y %H:%M:%S GMT'), + last_pub_date=( + pages[0][1]['published'].strftime('%a, %d %b %Y %H:%M:%S GMT') + if pages else '' + ), items='\n\n'.join([ '''