From nobody Wed May 14 16:01:36 2025 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; dkim=fail; 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1534581594114287.5235840415744; Sat, 18 Aug 2018 01:39:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90B22308212F; Sat, 18 Aug 2018 08:39:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8154628DE3; Sat, 18 Aug 2018 08:39:52 +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 6D657180613A; Sat, 18 Aug 2018 08:39:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7I8dpBl013198 for ; Sat, 18 Aug 2018 04:39:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id D1A63308BDA2; Sat, 18 Aug 2018 08:39:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C84EA308BDA0 for ; Sat, 18 Aug 2018 08:39:49 +0000 (UTC) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 106F2308A953 for ; Sat, 18 Aug 2018 08:39:48 +0000 (UTC) Received: by mail-wr1-f50.google.com with SMTP id z96-v6so268157wrb.8 for ; Sat, 18 Aug 2018 01:39:47 -0700 (PDT) Received: from donizetti.lan (dynamic-adsl-78-12-184-244.clienti.tiscali.it. [78.12.184.244]) by smtp.gmail.com with ESMTPSA id j39-v6sm4830677wre.44.2018.08.18.01.39.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Aug 2018 01:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=9F6iRmCnHZnzs1yZvbNKrcUGMJeOeIVwLfZA7GoFuek=; b=E3XcUIOEOTeI/9bbvRw3FWplyJXuesDu4xYqhz65mYqu04paJ2dQe/EbiRSaIFs2xm 4LMVyTkQHnohhVQAUa4ZO7FpuNdNn7tqENc6fWB+1MK9K76EYqeyIeQuY8PlIDMEXUw6 3uuHFwWN3tk6D+xbaVqEPH5Fk9LbkkBdQ+vtPsh7pXZgutjs+GIOtFgud+ehXEArmbuA Fky7Pdl5eKmRF+H5YvdhW1xHptRFhKakj/UMsKqQXoiRPBT8m7372UnCVhKxIBDrmV5q yCoP4BdjSlIzk9w33hZuJ1H3WLDz9fwZ7g391IADkgUNl5YZo6fi06M1WikxiqwuN+DY N18g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=9F6iRmCnHZnzs1yZvbNKrcUGMJeOeIVwLfZA7GoFuek=; b=byIQaukylymdwlbkOxtgmLjAGWeLZwtloUQ7QFThCTplzVWgE4KzTFpBfThG3vRO3V Uss5m/op3JGp6K0p/S+VJuQM5bvT0hHVh6KdP5LrmNDs08WREIGGRmK+diEQ9RinSQz6 2HsxLPJTWkZAjLo4yg/2viX2YBL6QEV0DfvMbosHscB8/j9WHI9fwULkNcjPZF8ZVKAV 8Gzf2tFyPxpl/zcw7OK0KcVnwjaQrZS12mNOMB9qgRDICucA7ZPnNV+VNoZtexireCJS uka22W8/PA0p0hAtIfsaQ0JbHoK8G8H8ZT93MfPLF6/ShMVlvsB+NAxQq+RmeX11RQ16 H/Mw== X-Gm-Message-State: AOUpUlEbASfzO7kAXUwWmJU5IfIfG5XeM05ia9xla3/BFIDt1OXLmd6t mAnjNzA3Cfp+RVuELWsayHLU0OT5 X-Google-Smtp-Source: AA+uWPwa7db64J8DcYbsZJFWPbgJr+OIv1m7RdD8ARFvp+e6czFVv5GXfwtUmvzLQT8I3GJt+EZWaA== X-Received: by 2002:adf:9a0b:: with SMTP id z11-v6mr22957772wrb.47.1534581586505; Sat, 18 Aug 2018 01:39:46 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Sat, 18 Aug 2018 10:39:36 +0200 Message-Id: <20180818083944.19692-2-pbonzini@redhat.com> In-Reply-To: <20180818083944.19692-1-pbonzini@redhat.com> References: <20180818083944.19692-1-pbonzini@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 18 Aug 2018 08:39:48 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Sat, 18 Aug 2018 08:39:48 +0000 (UTC) for IP:'209.85.221.50' DOMAIN:'mail-wr1-f50.google.com' HELO:'mail-wr1-f50.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.008 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.221.50 mail-wr1-f50.google.com 209.85.221.50 mail-wr1-f50.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 1/9] models: JSONField default should be empty dictionary, not empty string 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 18 Aug 2018 08:39:52 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_0 RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Otherwise, you could have a situation the REST API returns an empty string for a GET request, but JSONField complains when the same empty string is passed as a PUT request. Signed-off-by: Paolo Bonzini --- api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/models.py b/api/models.py index ad89cf8..eea924f 100644 --- a/api/models.py +++ b/api/models.py @@ -56,7 +56,7 @@ class Result(models.Model): code=3D'invalid')]) log_entry =3D models.OneToOneField(LogEntry, on_delete=3Dmodels.CASCAD= E, null=3DTrue) - data =3D jsonfield.JSONField() + data =3D jsonfield.JSONField(default=3D{}) =20 class Meta: index_together =3D [('status', 'name')] --=20 2.17.1 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel