Skip to content

AttributeError: 'AnonymousUser' object has no attribute 'is_admin' #3144

@sentry

Description

@sentry

Should check that a user is anonymous before checking if is_admin

Sentry Issue: STUDIO-EAV

AttributeError: 'AnonymousUser' object has no attribute 'is_admin'
(9 additional frame(s) were not displayed)
...
  File "rest_framework/views.py", line 455, in handle_exception
    self.raise_uncaught_exception(exc)
  File "rest_framework/views.py", line 492, in dispatch
    response = handler(request, *args, **kwargs)
  File "rest_framework/decorators.py", line 54, in handler
    return func(*args, **kwargs)
  File "contentcuration/views/nodes.py", line 38, in get_channel_details
    channel = get_object_or_404(Channel.filter_view_queryset(Channel.objects.all(), request.user), id=channel_id)
  File "contentcuration/models.py", line 753, in filter_view_queryset
    if user.is_admin:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions