fix: 修复view action获取

pull/7882/head
Jiangjie.Bai 2022-03-16 18:32:34 +08:00 committed by Jiangjie.Bai
parent 04b35ba520
commit aa9ae14e46
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class SimpleMetadataWithFilters(SimpleMetadata):
the fields that are accepted for 'PUT' and 'POST' methods. the fields that are accepted for 'PUT' and 'POST' methods.
""" """
actions = {} actions = {}
view.raw_action = view.action view.raw_action = getattr(view, 'action', None)
for method in self.methods & set(view.allowed_methods): for method in self.methods & set(view.allowed_methods):
if hasattr(view, 'action_map'): if hasattr(view, 'action_map'):
view.action = view.action_map.get(method.lower(), view.action) view.action = view.action_map.get(method.lower(), view.action)