From c103ca4e54f3cb736f0926813c46973a2ca365e2 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 24 Jan 2020 05:51:17 +0100 Subject: [PATCH] Use simple TemplateView for message_list (instead of unused ListView) --- .../apimail/assets/vue/components/MessagesTable.vue | 2 +- apimail/urls.py | 3 ++- apimail/views.py | 11 +---------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/apimail/static/apimail/assets/vue/components/MessagesTable.vue b/apimail/static/apimail/assets/vue/components/MessagesTable.vue index fb8e65c09..db2b6d52b 100644 --- a/apimail/static/apimail/assets/vue/components/MessagesTable.vue +++ b/apimail/static/apimail/assets/vue/components/MessagesTable.vue @@ -76,7 +76,7 @@ > <b-form-radio-group> <b-form-radio v-model="tagRequired" value="any">Any</b-form-radio> - <b-form-radio v-model="tagRequired" v-for="tag in tags" :value="tag.pk"> + <b-form-radio v-model="tagRequired" v-for="tag in tags" :value="tag.pk" :key="tag.pk"> <b-button size="sm" class="p-1" :variant="tag.variant"> {{ tag.unicode_symbol }} </b-button> diff --git a/apimail/urls.py b/apimail/urls.py index fdbfc9d55..d01a2845a 100644 --- a/apimail/urls.py +++ b/apimail/urls.py @@ -3,6 +3,7 @@ __license__ = "AGPL v3" from django.urls import include, path +from django.views.generic import TemplateView from apimail.api import views as apiviews from . import views @@ -68,7 +69,7 @@ urlpatterns = [ path( # /mail/messages 'messages', - views.StoredMessageListView.as_view(), + TemplateView.as_view(template_name='apimail/message_list.html'), name='message_list' ), path( # /mail/message/<uuid>/attachments/<int> diff --git a/apimail/views.py b/apimail/views.py index cfe19c850..dc4d44d57 100644 --- a/apimail/views.py +++ b/apimail/views.py @@ -6,17 +6,8 @@ import mimetypes from django.http import HttpResponse from django.shortcuts import get_object_or_404 -from django.views.generic.list import ListView -from .models import StoredMessage, StoredMessageAttachment - - -class StoredMessageListView(ListView): - model = StoredMessage - template_name = 'apimail/message_list.html' - - # def get_queryset(self): - # return StoredMessage.objects.filter_for_user(self.request.user) +from .models import StoredMessageAttachment def attachment_file(request, uuid, pk): -- GitLab