Opened 12 years ago

Closed 12 years ago

#570 closed defect (fixed)

Crash after adding media to an unspecified collection

Reported by: Jef van Schendel Owned by:
Priority: major Milestone: 0.3.3
Component: programming Keywords:
Cc: Parent Tickets:

Description

To reproduce:

  • Go to a media page
  • Click "Add media to collection"
  • On the resulting page, don't select a collection from the dropdown so it stays on "-- Select --"
  • Click "Add"
  • MediaGoblin crashes with this message: "AttributeError: 'NoneType' object has no attribute 'id'"

Possible options:

  • Return an error when no collection is specified
  • Remove the "-- Select --" option from the dropdown (thereby automatically selecting a certain collection - maybe the default "Favorites" collection we talked about?)

Change History (4)

comment:1 by Jef van Schendel, 12 years ago

Here's the full output:

Error - <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'id'
URL: http://127.0.0.1:6543/u/schendje/m/30/collect/
File '/usr/lib/python2.7/site-packages/paste/exceptions/errormiddleware.py', line 144 in __call__
  app_iter = self.application(environ, sr_checker)
File '/usr/lib/python2.7/site-packages/paste/urlmap.py', line 203 in __call__
  return app(environ, start_response)
File '/home/jef/mediagoblin/lib/python2.7/site-packages/Beaker-1.5.4-py2.7.egg/beaker/middleware.py', line 152 in __call__
  return self.wrap_app(environ, session_start_response)
File '/home/jef/mediagoblin/mediagoblin/app.py', line 234 in __call__
  return self.call_backend(environ, start_response)
File '/home/jef/mediagoblin/mediagoblin/app.py', line 221 in call_backend
  response = controller(request)
File '/home/jef/mediagoblin/mediagoblin/decorators.py', line 153 in wrapper
  return controller(request, media=media, *args, **kwargs)
File '/home/jef/mediagoblin/mediagoblin/decorators.py', line 52 in new_controller_func
  return controller(request, *args, **kwargs)
File '/home/jef/mediagoblin/mediagoblin/user_pages/views.py', line 224 in media_collect
  collection_item.collection = collection.id
AttributeError: 'NoneType' object has no attribute 'id'

comment:2 by Elrond, 12 years ago

Milestone: 0.3.3

comment:3 by spaetz, 12 years ago

I don't see this error at all. When I do that I get a message:

"You have to select or add a collection". Can you still reproduce this? (I use Firefox)

comment:4 by Jef van Schendel, 12 years ago

Resolution: fixed
Status: newclosed

I cannot reproduce it either. Assuming it was fixed.

Note: See TracTickets for help on using tickets.