Fix viewset.get_extra_actions

This commit is contained in:
Sumanth Ratna 2020-12-30 18:24:36 -05:00 committed by GitHub
parent 50496b5f4d
commit 8959e80cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = [