mirror of https://github.com/jumpserver/jumpserver
fix: 修复获取 Metadata 时,获取的总是 action 为 metadata
parent
4ef3b2630a
commit
a809eac2b8
|
@ -18,7 +18,7 @@ from rest_framework.request import clone_request
|
|||
class SimpleMetadataWithFilters(SimpleMetadata):
|
||||
"""Override SimpleMetadata, adding info about filters"""
|
||||
|
||||
methods = {"PUT", "POST", "GET"}
|
||||
methods = {"PUT", "POST", "GET", "PATCH"}
|
||||
attrs = [
|
||||
'read_only', 'label', 'help_text',
|
||||
'min_length', 'max_length',
|
||||
|
@ -32,6 +32,7 @@ class SimpleMetadataWithFilters(SimpleMetadata):
|
|||
"""
|
||||
actions = {}
|
||||
for method in self.methods & set(view.allowed_methods):
|
||||
view.action = view.action_map.get(method.lower(), view.action)
|
||||
view.request = clone_request(request, method)
|
||||
try:
|
||||
# Test global permissions
|
||||
|
|
Loading…
Reference in New Issue