mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-19 09:16:57 +00:00
[Update] 修复AssetUserViewSet 使用Option方法时error
This commit is contained in:
parent
6e5e340a25
commit
9341ce9f84
@ -84,12 +84,15 @@ class AssetUserViewSet(CommonApiMixin, BulkModelViewSet):
|
||||
|
||||
def get_object(self):
|
||||
pk = self.kwargs.get("pk")
|
||||
if pk is None:
|
||||
return
|
||||
queryset = self.get_queryset()
|
||||
obj = queryset.get(id=pk)
|
||||
return obj
|
||||
|
||||
def get_exception_handler(self):
|
||||
def handler(e, context):
|
||||
logger.error(e, exc_info=True)
|
||||
return Response({"error": str(e)}, status=400)
|
||||
return handler
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user