Message ID | 20170404213820.13350-2-stephen@that.guru |
---|---|
State | Accepted |
Headers | show
Return-Path: <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vyMmv3CkCz9s7c for <incoming@patchwork.ozlabs.org>; Wed, 5 Apr 2017 07:39:11 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="QbVgU26k"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vyMmv02pDzDqK7 for <incoming@patchwork.ozlabs.org>; Wed, 5 Apr 2017 07:39:11 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="QbVgU26k"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from butterfly.ash.relay.mailchannels.net (butterfly.ash.relay.mailchannels.net [23.83.222.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vyMmF6n6DzDqHG for <patchwork@lists.ozlabs.org>; Wed, 5 Apr 2017 07:38:37 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="QbVgU26k"; dkim-atps=neutral X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 71A68362226; Tue, 4 Apr 2017 21:38:32 +0000 (UTC) Received: from one.mxroute.com (unknown [100.96.126.101]) by relay.mailchannels.net (Postfix) with ESMTPA id 1450F362A30; Tue, 4 Apr 2017 21:38:32 +0000 (UTC) X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from one.mxroute.com (one-outgoing.mxroute.com [172.20.63.14]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.37); Tue, 04 Apr 2017 21:38:32 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: mxroute|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: mxroute X-Macabre-Tasty: 67bb5f9642ad5d2b_1491341912328_1239136504 X-MC-Loop-Signature: 1491341912328:288392044 X-MC-Ingress-Time: 1491341912327 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uq6UPl1Lczi2QF/6BKBMo4Fh+pB8bQzSFpAVRsQNbqM=; b=QbVgU26kqKrT28Qnd/HYN9/xb8 ZAqtab6ZjqQoYdByinrhhE0JPTbBhz0hf4Tm1BBqQanEqg4N8Qlul2mg2+niw5Zx1TqNCnJ2qq5se m9ri2zSWrkry8x27dNDQzqGtfXIi+DdZrkXgrcMHcB+0ihES9Eo/0/1ekkki7pw/Tdtj6wvCfTz2P OXNV/URiJqkbFnt1qriZnlO+UqxAzqfLJtFkouahGpC2dAcG1Qs4HQ+FYCYf3EKR/BUiqpik/EuP1 PQEhbYVFtPCzEmJ+EtqULirQeGU4/SLBd8g9xm8HYPZBU2RSn7OuOqaI6qXdaiy4jje0DHCd2rfBq A+9AWj9g==; From: Stephen Finucane <stephen@that.guru> To: patchwork@lists.ozlabs.org Subject: [PATCH 2/4] compat: Add non-None queryset attribute Date: Tue, 4 Apr 2017 22:38:18 +0100 Message-Id: <20170404213820.13350-2-stephen@that.guru> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170404213820.13350-1-stephen@that.guru> References: <20170404213820.13350-1-stephen@that.guru> X-OutGoing-Spam-Status: No, score=-10.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Patchwork development <patchwork.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/patchwork>, <mailto:patchwork-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/patchwork/> List-Post: <mailto:patchwork@lists.ozlabs.org> List-Help: <mailto:patchwork-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/patchwork>, <mailto:patchwork-request@lists.ozlabs.org?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org> |
diff --git a/patchwork/api/patch.py b/patchwork/api/patch.py index ded4910..fa6fb46 100644 --- a/patchwork/api/patch.py +++ b/patchwork/api/patch.py @@ -53,6 +53,7 @@ class StateField(RelatedField): 'incorrect_type': _('Incorrect type. Expected string value, received ' '{data_type}.'), } + queryset = '' # django 1.6, rest_framework 3.2 require this def to_internal_value(self, data): try:
Older versions of Django REST Framework's 'RelatedField' did not check for the presence 'get_queryset' before checking for a 'queryset' attribute. This was fixed in 3.4.0 [1] and backported to the 3.3 series in 3.3.3 [2]. However, the fix was not backported to the last release of 3.2 series [3], which is the last release to support Django 1.6. As such, we must set a 'queryset' attribute, even if it's set to a garbage value. [1] ../blob/3.4.0/rest_framework/relations.py#L78-L82 [2] ../blob/3.3.3/rest_framework/relations.py#L78-L82 [3] ../blob/3.2.5/rest_framework/relations.py#L64-L67 Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Daniel Axtens <dja@axtens.net> Closes-bug: #94 --- patchwork/api/patch.py | 1 + 1 file changed, 1 insertion(+)