requesting user's mugshot via api OOPS when user is using the default one
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned |
Bug Description
Trying to get the mugshot of an user who is using the default one results in a 404 error and raises an OOPS. This should either return None or the default one.
In [1]: ajmitch = launchpad.
send: 'GET /beta/~ajmitch HTTP/1.1\r\nHost: api.edge.
reply: 'HTTP/1.1 304 Not Modified\r\n'
header: Date: Mon, 02 Mar 2009 22:10:27 GMT
header: Server: zope.server.http (HTTP)
header: Etag: "231c4eae421edb
header: Vary: Cookie,
In [2]: ajmitch.
send: 'GET /beta/~
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Mon, 02 Mar 2009 22:10:31 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: X-Lazr-Oopsid: OOPS-1157ED150
header: Content-Type: text/plain
header: Content-Length: 108
header: Via: 1.1 wildcard.
send: 'GET /beta/~
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Date: Mon, 02 Mar 2009 22:10:32 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: X-Lazr-Oopsid: OOPS-1157EB167
header: Content-Type: text/plain
header: Content-Length: 108
header: Via: 1.1 wildcard.
-------
HTTPError Traceback (most recent call last)
/home/markus/
/media/
730 """Open the file on the server for read or write access."""
731 if mode in ('r', 'w'):
--> 732 return HostedFileBuffe
733 else:
734 raise ValueError("Invalid mode. Supported modes are: r, w")
/media/
755 "specify filename.")
756 response, value = hosted_
--> 757 self.url, return_
758 content_type = response[
759 last_modified = response[
/media/
220 method = resource_
221 url = method.
--> 222 response, content = self._request(url, extra_headers=
223 if return_response:
224 return (response, content)
/media/
210 # Turn non-2xx responses into exceptions.
211 if response.status // 100 != 2:
--> 212 raise HTTPError(response, content)
213 return response, content
214
HTTPError: HTTP Error 404: Not Found
-------
Response: {'content-length': '108',
'content-type': 'text/plain',
'date': 'Mon, 02 Mar 2009 22:10:32 GMT',
'server': 'zope.server.http (HTTP)',
'status': '404',
'via': '1.1 wildcard.
'x-lazr-oopsid': 'OOPS-1157EB167',
'x-powered-by': 'Zope (www.zope.org), Python (www.python.org)'}
Content: "Object: <canonical.
-------
In [3]:
Changed in launchpad-registry: | |
status: | New → Triaged |
Changed in launchpad-registry: | |
importance: | Undecided → Low |
tags: |
added: users removed: registry-people |
The real oops is launchpad. rest.bytestorag e.LibraryBacked ByteStorage object at 0xb040dd0>, name: 'mugshot'
NotFound: Object: <canonical.
Traceback (most recent call last): publish, line 133, in publish callObject( request, obj) launchpad. webapp. servers, line 1234, in callObject ePublication, self).callObject( launchpad. webapp. publication, line 354, in callObject getPositionalAr guments( ), request) publish, line 108, in mapply lazr.rest. bytestorage. ByteStorageReso urce instance at 0xb040650> publish, line 114, in debug_call lazr.rest. bytestorage, line 25, in __call__ lazr.rest. bytestorage, line 55, in do_GET self.context, self.context. filename, self.request) launchpad. rest.bytestorag e.LibraryBacked ByteStorage object at 0xb040dd0>, name: 'mugshot'
Module zope.publisher.
result = publication.
Module canonical.
value = super(WebServic
Module canonical.
return mapply(ob, request.
Module zope.publisher.
return debug_call(obj, args)
- __traceback_info__: <security proxied canonical.
Module zope.publisher.
return obj(*args)
Module canonical.
return self.do_GET()
Module canonical.
raise NotFound(
NotFound: Object: <canonical.
I have looked at the interface: eUpload(
title= _("Mugshot" ), required=False, default_ image_resource= '/@@/person- mugshot' , ...)
MugshotImag
and the field BaseImageUpload. It does not appear to use default_ image_resource after it is set in the __init__ method. image_resource or something in the API must become much smarter about how to handle this situation.
I think the getCurrentImage() method should set the current var to self.default_