Opened 10 years ago

Closed 10 years ago

#1078 closed defect (fixed)

/api/user/<user>/inbox gives error 500

Reported by: Jonas Haraldsson Owned by:
Priority: major Milestone: 0.8.0
Component: programming Keywords: api, inbox
Cc: Parent Tickets:


Error - <type 'exceptions.AttributeError'>: 'list' object has no attribute 'order_by'
URL: http://mediagoblin.jonash.local/api/user/kabniel/inbox
File '/srv/mediagoblin.local/mediagoblin/local/lib/python2.7/site-packages/Paste-', line 144 in __call__
  app_iter = self.application(environ, sr_checker)
File '/srv/mediagoblin.local/mediagoblin/mediagoblin/', line 342 in __call__
  return self.call_backend(environ, start_response)
File '/srv/mediagoblin.local/mediagoblin/local/lib/python2.7/site-packages/Werkzeug-0.9.6-py2.7.egg/werkzeug/', line 588 in __call__
  return, start_response)
File '/srv/mediagoblin.local/mediagoblin/mediagoblin/', line 276 in call_backend
  return self._finish_call_backend(request, environ, start_response)
File '/srv/mediagoblin.local/mediagoblin/mediagoblin/', line 318 in _finish_call_backend
  response = controller(request)
File '/srv/mediagoblin.local/mediagoblin/mediagoblin/', line 427 in wrapper
  return controller(request, *args, **kwargs)
File '/srv/mediagoblin.local/mediagoblin/mediagoblin/federation/', line 163 in inbox_endpoint
  inbox = inbox.order_by(Activity.published.desc())
AttributeError: 'list' object has no attribute 'order_by'

Change History (2)

comment:1 by Jonas Haraldsson, 10 years ago

I'm not experienced in sqlalchemy, but possibly fixed by removing .all() in, line 159.

.all() returns python list, which i dont think we want.

Last edited 10 years ago by Jonas Haraldsson (previous) (diff)

comment:2 by Jessica Tallon, 10 years ago

Resolution: fixed
Status: newclosed

You're right .all does indeed return a list. Removing .all has fixed the issue, which is no on master as of 95dbed2.

Note: See TracTickets for help on using tickets.