[prod][traceback] AttributeError: 'unicode' object has no attribute 'name'

VERIFIED FIXED

Status

VERIFIED FIXED
3 years ago
3 years ago

People

(Reporter: nemo-yiannis, Assigned: nemo-yiannis)

Tracking

2015-10.2

Details

(Assignee)

Description

3 years ago
Internal Server Error: /api/v2/users/1377/
Traceback (most recent call last):
  File "/data/www/mozillians.org/mozillians/vendor-local/src/django/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/newrelic-2.52.0.40/newrelic/hooks/framework_django.py", line 499, in wrapper
    return wrapped(*args, **kwargs)
  File "/data/www/mozillians.org/mozillians/vendor-local/src/django/django/views/decorators/csrf.py", line 57, in wrapped_view
    return view_func(*args, **kwargs)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/viewsets.py", line 79, in view
    return self.dispatch(request, *args, **kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/newrelic-2.52.0.40/newrelic/hooks/component_djangorestframework.py", line 27, in _nr_wrapper_APIView_dispatch_
    return wrapped(*args, **kwargs)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/views.py", line 402, in dispatch
    response = self.handle_exception(exc)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/views.py", line 399, in dispatch
    response = handler(request, *args, **kwargs)
  File "/data/www/mozillians.org/mozillians/mozillians/users/api/v2.py", line 216, in retrieve
    return Response(serializer.data)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/serializers.py", line 583, in data
    self._data = self.to_native(obj)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/serializers.py", line 362, in to_native
    value = field.field_to_native(obj, field_name)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/fields.py", line 336, in field_to_native
    return super(WritableField, self).field_to_native(obj, field_name)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/fields.py", line 211, in field_to_native
    return self.to_native(value)
  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/rest_framework/fields.py", line 978, in to_native
    return value.name
AttributeError: 'unicode' object has no attribute 'name'
(Assignee)

Updated

3 years ago
Assignee: nobody → jgiannelos

Comment 1

3 years ago
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/99d2ecd74a84dde1248c254fd589dbdca53a5904
[Fix bug 1216291] Fix `photo` definition in UserProfileDetailedSerializer.

https://github.com/mozilla/mozillians/commit/f4397305d45e5672999e68ea6facbef6d61f9df7
Merge pull request #1260 from johngian/fix-1216291

[Fix bug 1216291] Fix photo field definition in users api serializer.

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED

Updated

3 years ago
Version: other → next
(Assignee)

Comment 2

3 years ago
Verified on stage:
* API key: "public", photo: "mozillians"
* GET /api/v2/users/<user_id>
 * returns default mozillians placeholder photo

* API key: "privileged", photo: "public"
* GET /api/v2/users/<user_id>
 * returns profile photo as expected
Status: RESOLVED → VERIFIED
(Assignee)

Updated

3 years ago
Version: next → 2015-10.2
You need to log in before you can comment on or make changes to this bug.