From nobody Sat Apr 27 02:11:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557156724; cv=none; d=zoho.com; s=zohoarc; b=cxkFPPAxuWfpq/4iCLvWDk4B2Goeg8vnexK0oE905/F2jWUfa6NcQc4hewMz0bne8ec5+PyBmPxRPi/a4q0u0kFOTzlZzHUPic5kaSibUAEFkFu5KsFrJOOZNcX2aGoqDp4ryqXGeWrMrYgNKiBJ8vnyyLcKX/OX16KFrL65yUM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557156724; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=mmDZObE97IiROBG/nM+M7ERayr0rgQuN/B1BlQ5nnmw=; b=jn2ES4vctdR04PpyM5kfDmheLVInEz9ThJSSMOdmv6SzCkz3hA03cJY+0Fo1LZ3hum1jst8PkoptDsV6v6ZRo7FgJBcza+uX16Qz3xKZj7qXnbiVd/h4aja0zV4dYeOD+uTLWs2bPlDz4TZku302ytpnJ7u/fNv+5Kw8YTmz1Kk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557156724617257.5641803738089; Mon, 6 May 2019 08:32:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F5975D601; Mon, 6 May 2019 15:32:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8554F7C3F8; Mon, 6 May 2019 15:32:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7B7603FB11; Mon, 6 May 2019 15:32:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x46FW2j3006500 for ; Mon, 6 May 2019 11:32:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 66BF319749; Mon, 6 May 2019 15:32:02 +0000 (UTC) Received: from donizetti.redhat.com (unknown [10.36.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id A919645DB for ; Mon, 6 May 2019 15:31:58 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Mon, 6 May 2019 10:31:56 -0500 Message-Id: <20190506153156.25069-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] rest: use @action instead of @detail_route X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 06 May 2019 15:32:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The detail_route decorator is deprecated and will be removed in 3.10 in fav= or of "`action`, which accepts a `detail` bool. Use `@action(detail=3DTrue)` inst= ead. Signed-off-by: Paolo Bonzini --- api/rest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/rest.py b/api/rest.py index 041e82d..4d08e16 100644 --- a/api/rest.py +++ b/api/rest.py @@ -18,7 +18,7 @@ from .models import Project, ProjectResult, Message, Mess= ageResult, Result from .search import SearchEngine from rest_framework import (permissions, serializers, viewsets, filters, mixins, renderers, status) -from rest_framework.decorators import detail_route, action +from rest_framework.decorators import action from rest_framework.fields import SerializerMethodField, CharField, JSONFi= eld, EmailField, ListField from rest_framework.relations import HyperlinkedIdentityField from rest_framework.response import Response @@ -484,12 +484,12 @@ class ProjectMessagesViewSet(ProjectMessagesViewSetMi= xin, serializer_class =3D MessageSerializer parser_classes =3D (JSONParser, MessagePlainTextParser, ) =20 - @detail_route(renderer_classes=3D[StaticTextRenderer]) + @action(detail=3DTrue, renderer_classes=3D[StaticTextRenderer]) def mbox(self, request, *args, **kwargs): message =3D self.get_object() return Response(message.get_mbox()) =20 - @detail_route() + @action(detail=3DTrue) def replies(self, request, *args, **kwargs): message =3D self.get_object() replies =3D Message.objects.filter(in_reply_to=3Dmessage.message_i= d, --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel