fix: metadata api view 报错

pull/6220/head
xinwen 2021-06-02 19:11:08 +08:00 committed by 老广
parent a809eac2b8
commit a9bdbcf7c6
1 changed files with 3 additions and 1 deletions

View File

@ -32,7 +32,9 @@ class SimpleMetadataWithFilters(SimpleMetadata):
"""
actions = {}
for method in self.methods & set(view.allowed_methods):
view.action = view.action_map.get(method.lower(), view.action)
if hasattr(view, 'action_map'):
view.action = view.action_map.get(method.lower(), view.action)
view.request = clone_request(request, method)
try:
# Test global permissions