Skip to content

Unrelated assert error message when there is an error in get_queryset #4585

@Neraste

Description

@Neraste

In a view, I have define a get_queryset method in a APIView derived class. For some (not important) reasons, I have made a mistake in my code, but the error message I get is unrelated to the actual mistake: it is an AssertError, complaining there is no .queryset attribute or get_queryset method in the view. And the traceback does only imply files of the framework, not files I haver written and, obviously, neither the file I have made the mistake in.

Steps to reproduce

Create a class in views.py, deriving from APIView. Define a get_queryset method with a mistake in it, say an IndexError. the method do not return anything. Run it.

Txpected behavior

Get an error message involving an IndexError.
Get an error message about the empty return of get_queryset.

Actual behavior

Get an error message related to an AssertError.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy