Merge pull request #3994 from jumpserver/lina_assetuser

[Update] 修复AssetUserViewSet 使用Option方法时error
pull/4019/head
BaiJiangJie 5 years ago committed by GitHub
commit b789a8bb05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save