mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 16:40:03 +03:00
Fix viewset.get_extra_actions
This commit is contained in:
parent
50496b5f4d
commit
8959e80cd7
|
@ -151,7 +151,7 @@ class SimpleRouter(BaseRouter):
|
||||||
# converting to list as iterables are good for one pass, known host needs to be checked again and again for
|
# converting to list as iterables are good for one pass, known host needs to be checked again and again for
|
||||||
# different functions.
|
# different functions.
|
||||||
known_actions = list(flatten([route.mapping.values() for route in self.routes if isinstance(route, Route)]))
|
known_actions = list(flatten([route.mapping.values() for route in self.routes if isinstance(route, Route)]))
|
||||||
extra_actions = viewset.get_extra_actions()
|
extra_actions = viewset.get_extra_actions() if isinstance(viewset, ViewSet) else []
|
||||||
|
|
||||||
# checking action names against the known actions list
|
# checking action names against the known actions list
|
||||||
not_allowed = [
|
not_allowed = [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user