manosim / manosim/django-rest-framework-docs

api_endpoint __get_permissions_class__ missing __name__

Open
#181 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
641
Forks
178
PR merge metrics
No merged PRs in 30d

Description

with DRF 3.9.1 we have errors for custom permissions with following exception
```AttributeError: OperandHolder instance has no attribute '__name__'```

the `self.pattern.callback.cls.permission_classes` seems to return a mix of classes and instances (e.g. for a subclass of DjangoObjectPermissions)

Contributor guide

Open the contributing guide

Research direction

Start by locating the api_endpoint __get_permissions_class__ implementation and reproduce the reported error with Django REST Framework 3.9.1 and a custom permission based on DjangoObjectPermissions. Check how self.pattern.callback.cls.permission_classes handles permission classes and instances; done means the endpoint no longer raises AttributeError for valid custom permissions.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.