From 0e9e57ea306dd6aad2283f2998a54314b4cf448f Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Mon, 11 May 2020 23:36:47 +1000 Subject: [PATCH] Fix error generating Atom feed upon blank title [#1018]. --- mediagoblin/listings/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mediagoblin/listings/views.py b/mediagoblin/listings/views.py index 6e1528ca..4dd93543 100644 --- a/mediagoblin/listings/views.py +++ b/mediagoblin/listings/views.py @@ -21,6 +21,7 @@ from mediagoblin.decorators import uses_pagination from mediagoblin.plugins.api.tools import get_media_file_paths from mediagoblin.tools.pagination import Pagination from mediagoblin.tools.response import render_to_response +from mediagoblin.tools.translate import pass_to_ugettext as _ from werkzeug.contrib.atom import AtomFeed @@ -115,7 +116,9 @@ def atom_feed(request): content = entry.description_html feed.add( - entry.get('title'), + # AtomFeed requires a non-blank title. This situation can occur if + # you edit a media item and blank out the existing title. + entry.get('title') or _('Untitled'), content, id=entry.url_for_self(request.urlgen, qualified=True), content_type='html', -- 2.25.1