MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / inner

Function inner

apps/common/log/log.py:90–116  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

88 """
89
90 def inner(func):
91 def run(view, request, **kwargs):
92 status = 200
93 operation_object = {}
94 try:
95 if get_operation_object is not None:
96 operation_object = get_operation_object(request, kwargs)
97 except Exception as e:
98 pass
99 try:
100 return func(view, request, **kwargs)
101 except Exception as e:
102 status = 500
103 raise e
104 finally:
105 ip = get_ip_address(request)
106 user = get_user(request)
107 details = get_details(request)
108 workspace_id = get_workspace_id(request, kwargs)
109 _operate = operate
110 if callable(operate):
111 _operate = operate(request)
112 # 插入审计日志
113 Log(menu=menu, operate=_operate, user=user, status=status, ip_address=ip, details=details,
114 operation_object=operation_object, workspace_id=workspace_id).save()
115
116 return run
117
118 return inner
119

Callers 4

putMethod · 0.50
putMethod · 0.50
putMethod · 0.50
putMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected