From 257ee205acfb35ae81cadcd6148abf6263b4e990 Mon Sep 17 00:00:00 2001 From: "faming.zhou" Date: Fri, 29 Dec 2023 11:32:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UNION=20=E7=9A=84=E7=B1=BB=E5=9E=8B=20ch?= =?UTF-8?q?aracter=20varying=20=E5=92=8C=20uuid=20=E4=B8=8D=E5=8C=B9?= =?UTF-8?q?=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/audits/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/audits/api.py b/apps/audits/api.py index c2cd84756..7dc1a5725 100644 --- a/apps/audits/api.py +++ b/apps/audits/api.py @@ -5,6 +5,7 @@ from importlib import import_module from django.conf import settings from django.db.models import F, Value, CharField, Q +from django.db.models.functions import Cast from django.http import HttpResponse, FileResponse from django.utils.encoding import escape_uri_path from rest_framework import generics @@ -163,7 +164,7 @@ class ResourceActivityAPIView(generics.ListAPIView): q |= Q(user=str(user)) queryset = OperateLog.objects.filter(q, org_q).annotate( r_type=Value(ActivityChoices.operate_log, CharField()), - r_detail_id=F('id'), r_detail=Value(None, CharField()), + r_detail_id=Cast(F('id'), CharField()), r_detail=Value(None, CharField()), r_user=F('user'), r_action=F('action'), ).values(*fields)[:limit] return queryset