[dev][traceback] UndefinedError: 'django.contrib.auth.models.AnonymousUser object' has no attribute 'userprofile'

VERIFIED FIXED in 2013-06-27

Status

Participation Infrastructure
Phonebook
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: mbrandt, Assigned: giorgos)

Tracking

other
2013-06-27

Details

(Whiteboard: [kb=1012357] [fromAutomation][dev])

(Reporter)

Description

5 years ago
Steps to reproduce:
1. goto http://mozillians-dev.allizom.org/nl/u/MozilliansUser/

Actual:
Traceback (most recent call last):

  File "/data/www/mozillians-dev.allizom.org/mozillians/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/hooks/framework_django.py", line 475, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/mozillians-dev.allizom.org/mozillians/vendor/src/django/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians-dev.allizom.org/mozillians/apps/phonebook/views.py", line 98, in view_profile
    return render(request, 'phonebook/profile.html', data)

  File "/data/www/mozillians-dev.allizom.org/mozillians/vendor/src/django/django/shortcuts/__init__.py", line 44, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),

  File "/data/www/mozillians-dev.allizom.org/mozillians/vendor/src/django/django/template/loader.py", line 176, in render_to_string
    return t.render(context_instance)

  File "/data/www/mozillians-dev.allizom.org/mozillians/vendor/src/jingo/jingo/__init__.py", line 189, in render
    return super(Template, self).render(context_dict)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/function_trace.py", line 82, in dynamic_wrapper
    return wrapped(*args, **kwargs)

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/mozillians-dev.allizom.org/mozillians/apps/phonebook/templates/phonebook/profile.html", line 1, in top-level template code
    {% extends "base.html" %}

  File "/data/www/mozillians-dev.allizom.org/mozillians/templates/base.html", line 152, in top-level template code
    {% block content_wrapper %}

  File "/data/www/mozillians-dev.allizom.org/mozillians/templates/base.html", line 155, in block "content_wrapper"
    {% block content %}{% endblock %}

  File "/data/www/mozillians-dev.allizom.org/mozillians/apps/phonebook/templates/phonebook/profile.html", line 83, in block "content"
    <img src="{{ user.userprofile.get_photo_url('150x150') }}" alt="{{ user.username }}">

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 371, in getattr
    return getattr(obj, attribute)

UndefinedError: 'django.contrib.auth.models.AnonymousUser object' has no attribute 'userprofile'
Whiteboard: [fromAutomation][dev] → [kb=1012357] [fromAutomation][dev]
(Assignee)

Updated

5 years ago
Assignee: nobody → giorgos
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2013-07-04
Target Milestone: 2013-07-04 → 2013-06-27
(Reporter)

Comment 2

5 years ago
Thank you :hoosteeno. QA verified on stage - I am unable to reproduce the error outlined in comment 0.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.