Opened 5 years ago

Last modified 2 years ago

#1018 in_progress defect

atom feed fails when untitled media is included

Reported by: ayleph Owned by: jsandoval
Priority: major Milestone:
Component: programming Keywords: feed, atom, title, bitesized
Cc: Parent Tickets:

Description

Trying to view an atom feed which includes media without a title returns a server error. The log output is below.

Error - <type 'exceptions.ValueError'>: title is required
URL: https://goblinrefuge.com/mediagoblin/u/joauti/atom/
File '/path/to/mediagoblin/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/exceptions/errormiddleware.py', line 144 in __call__
  app_iter = self.application(environ, sr_checker)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Paste-1.7.5.1-py2.7.egg/paste/urlmap.py', line 203 in __call__
  return app(environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 268 in __call__
  return self.call_backend(environ, start_response)
File '/path/to/mediagoblin/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/wsgi.py', line 588 in __call__
  return self.app(environ, start_response)
File '/path/to/mediagoblin/mediagoblin/app.py', line 245 in call_backend
  response = controller(request)
File '/path/to/mediagoblin/mediagoblin/user_pages/views.py', line 542 in atom_feed
  'type': 'text/html'}])
File '/path/to/mediagoblin/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/contrib/atom.py', line 144 in add
  self.entries.append(FeedEntry(*args, **kwargs))
File '/path/to/mediagoblin/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/contrib/atom.py', line 294 in __init__
  raise ValueError('title is required')
ValueError: title is required

So how do you get media without a title? Upload media, edit it, clear the title, and save changes. Maybe saving media with no title should not be allowed.

Subtickets

Change History (2)

comment:1 Changed 3 years ago by Ben Sturmfels

Keywords: bitesized added

Marking as "bitesized" since this is self-contained and should be fairly straightforward to fix. The feed should accommodate whatever is in the database as the title - we can't necessarily rely on input validation.

comment:2 Changed 2 years ago by jsandoval

Owner: set to jsandoval
Status: newin_progress
Note: See TracTickets for help on using tickets.