diff options
author | Stephen Finucane <stephen@that.guru> | 2020-04-09 00:00:10 +0100 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2020-04-26 13:45:42 +0100 |
commit | 1d063dbfa8be885b01dc68596512901c5f413cde (patch) | |
tree | 3ab1859b65856f49cfa05af98d5a33a906f75a36 | |
parent | c8a799fc54875393adf60a7d7f90c9baf6b388ca (diff) | |
download | patchwork-1d063dbfa8be885b01dc68596512901c5f413cde.tar patchwork-1d063dbfa8be885b01dc68596512901c5f413cde.tar.gz |
Remove unnecessary references to Submission model
We want to drop this in future changes. Start by removing any
unnecessary references.
Signed-off-by: Stephen Finucane <stephen@that.guru>
-rw-r--r-- | patchwork/admin.py | 6 | ||||
-rw-r--r-- | patchwork/views/cover.py | 10 | ||||
-rw-r--r-- | patchwork/views/patch.py | 10 |
3 files changed, 14 insertions, 12 deletions
diff --git a/patchwork/admin.py b/patchwork/admin.py index c3d4524..fb79808 100644 --- a/patchwork/admin.py +++ b/patchwork/admin.py @@ -20,7 +20,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 @@ -76,15 +75,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 54962ab..e90b737 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 470ad19..9fdbbf9 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: - 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, |