Merge pull request #3994 from jumpserver/lina_assetuser

[Update] 修复AssetUserViewSet 使用Option方法时error
This commit is contained in:
BaiJiangJie
2020-05-12 20:32:58 +08:00
committed by GitHub

View File

@@ -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