Skip to content

has_permission gets called twice #8987

@aminiun

Description

@aminiun

Hi!
In drf==3.14, the has_object_permission code has changed in OR class in 4aea8dd.

The problem is, we are calling has_permission twice here, and I have some queries in my custom permission class, in has_permission method. So for each request, my queries are running twice and it makes my API slow.

I'd love to fix it myself, but I couldn't achieve any good solution for preventing calling has_permission again.
Any idea ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions