Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
Only try to attach user info if its an instance of django.contrib.auth
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Feb 5, 2012
1 parent 5f9a7ca commit 039dbfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion raven/contrib/django/__init__.py
Expand Up @@ -11,6 +11,7 @@
import logging

from django.conf import settings
from django.contrib.auth.models import User, AnonymousUser
from django.http import HttpRequest
from django.template import TemplateSyntaxError
from django.template.loader import LoaderOrigin
Expand Down Expand Up @@ -61,7 +62,7 @@ def get_data_from_request(self, request):
}
}

if hasattr(request, 'user'):
if hasattr(request, 'user') and isinstance(request.user, (User, AnonymousUser)):
result['sentry.interfaces.User'] = self.get_user_info(request)

return result
Expand Down

0 comments on commit 039dbfa

Please sign in to comment.