From patchwork Wed Mar 4 11:54:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 1248971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48XXR962jJz9sQt for ; Wed, 4 Mar 2020 22:56:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=default header.b=r3MSXzVU; 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 48XXR94zx0zDqW9 for ; Wed, 4 Mar 2020 22:56:37 +1100 (AEDT) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=that.guru (client-ip=199.181.239.116; helo=relay0116.mxlogin.com; envelope-from=stephen@that.guru; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=that.guru Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=that.guru header.i=@that.guru header.a=rsa-sha256 header.s=default header.b=r3MSXzVU; dkim-atps=neutral Received: from relay0116.mxlogin.com (relay0116.mxlogin.com [199.181.239.116]) (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 48XXPX3tmMzDqW5 for ; Wed, 4 Mar 2020 22:55:11 +1100 (AEDT) Received: from filter004.mxroute.com ([149.28.56.236] 149.28.56.236.vultr.com) (Authenticated sender: mN4UYu2MZsgR) by relay0116.mxlogin.com (ZoneMTA) with ESMTPSA id 170a56642e0000c6c5.002 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 04 Mar 2020 11:55:07 +0000 X-Zone-Loop: e149df2b232f0cc121a3b30dd2aa0329b4a50988a90a X-Originating-IP: [149.28.56.236] Received: from one.mxroute.com (one.mxroute.com [195.201.59.211]) by filter004.mxroute.com (Postfix) with ESMTPS id 64E773ED96; Wed, 4 Mar 2020 11:55:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=rIaKxlE6ruO5DgpBMEAtq5RyrZtbh7iQBYAaXDaB9vI=; b=r3MSXzVUKbgRHXUBn3gxLuFz5R KX4M9k8KLcVc4TDhL0xyxlFvrOqMrGOOzDUkR2NW5PLw9eCRWfUGz9ZKSwcnroE6XMy+hkjvch07O XP9UnzoaOdFPe7eRJMGafAct40MEFu0O3BKvfyTQ0h1+UVq49ABGpnsU9LV66HdLM/QJx05ON64Qw xiuVEALYfcXNomsUW3SxmwHi50l5UZj+uEKW8oqaw8GMiLin2BHI/3OQjFqL/8t5JEoRXIi+5998L KDLiq3pi5+m6StbsYDJRKJtHlYBOf9DpF3YMm1DzGQ5rY78DfRQcD+SkSLe6J3clK01NZ3sO38l6k RgcMIn0Q==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 2/5] Remove unnecessary references to Submission model Date: Wed, 4 Mar 2020 11:54:54 +0000 Message-Id: <20200304115457.32300-3-stephen@that.guru> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200304115457.32300-1-stephen@that.guru> References: <20200304115457.32300-1-stephen@that.guru> MIME-Version: 1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" We want to drop this in future changes. Start by removing any unnecessary references. Signed-off-by: Stephen Finucane Reviewed-by: Andrew Donnellan --- patchwork/admin.py | 6 ++---- patchwork/views/cover.py | 10 ++++++---- patchwork/views/patch.py | 10 ++++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/patchwork/admin.py b/patchwork/admin.py index f9a94c6f..d4ab109c 100644 --- a/patchwork/admin.py +++ b/patchwork/admin.py @@ -19,7 +19,6 @@ from patchwork.models import Project from patchwork.models import Series from patchwork.models import SeriesReference from patchwork.models import State -from patchwork.models import Submission from patchwork.models import Tag from patchwork.models import UserProfile @@ -75,15 +74,14 @@ class StateAdmin(admin.ModelAdmin): admin.site.register(State, StateAdmin) -class SubmissionAdmin(admin.ModelAdmin): +class CoverLetterAdmin(admin.ModelAdmin): list_display = ('name', 'submitter', 'project', 'date') list_filter = ('project', ) search_fields = ('name', 'submitter__name', 'submitter__email') date_hierarchy = 'date' -admin.site.register(Submission, SubmissionAdmin) -admin.site.register(CoverLetter, SubmissionAdmin) +admin.site.register(CoverLetter, CoverLetterAdmin) class PatchAdmin(admin.ModelAdmin): diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index 54962abb..e90b7373 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -11,8 +11,8 @@ from django.shortcuts import render from django.urls import reverse from patchwork.models import CoverLetter +from patchwork.models import Patch from patchwork.models import Project -from patchwork.models import Submission from patchwork.views.utils import cover_to_mbox @@ -25,9 +25,11 @@ def cover_detail(request, project_id, msgid): cover = get_object_or_404(CoverLetter, project_id=project.id, msgid=db_msgid) except Http404 as exc: - submissions = Submission.objects.filter(project_id=project.id, - msgid=db_msgid) - if submissions: + patches = Patch.objects.filter( + project_id=project.id, + msgid=db_msgid, + ) + if patches: return HttpResponseRedirect( reverse('patch-detail', kwargs={'project_id': project.linkname, diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index f34053ce..bc508bee 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -15,9 +15,9 @@ from django.urls import reverse from patchwork.forms import CreateBundleForm from patchwork.forms import PatchForm from patchwork.models import Bundle +from patchwork.models import CoverLetter from patchwork.models import Patch from patchwork.models import Project -from patchwork.models import Submission from patchwork.views import generic_list from patchwork.views.utils import patch_to_mbox from patchwork.views.utils import series_patch_to_mbox @@ -42,9 +42,11 @@ def patch_detail(request, project_id, msgid): try: patch = Patch.objects.get(project_id=project.id, msgid=db_msgid) except Patch.DoesNotExist as exc: - submissions = Submission.objects.filter(project_id=project.id, - msgid=db_msgid) - if submissions: + covers = CoverLetter.objects.filter( + project_id=project.id, + msgid=db_msgid, + ) + if covers: return HttpResponseRedirect( reverse('cover-detail', kwargs={'project_id': project.linkname,