From 96e33815f5738782e364a6cb5fab17db82c2f402 Mon Sep 17 00:00:00 2001 From: Bartuccio Antoine Date: Thu, 18 Apr 2019 11:16:34 +0200 Subject: [PATCH] Group: simplify GroupTemplateView and better group display --- core/templates/core/group_detail.jinja | 2 +- core/views/group.py | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/templates/core/group_detail.jinja b/core/templates/core/group_detail.jinja index e7da48b9..45c857e4 100644 --- a/core/templates/core/group_detail.jinja +++ b/core/templates/core/group_detail.jinja @@ -16,8 +16,8 @@ {{ form.users_removed.errors }} {% for user in form.users_removed %} {% endfor %} diff --git a/core/views/group.py b/core/views/group.py index bbb24aa3..059c5dc5 100644 --- a/core/views/group.py +++ b/core/views/group.py @@ -130,12 +130,6 @@ class GroupTemplateView(CanEditMixin, DetailFormView): pk_url_kwarg = "group_id" template_name = "core/group_detail.jinja" - def dispatch(self, request, *args, **kwargs): - - self.users = self.get_object().users.all() - resp = super(GroupTemplateView, self).dispatch(request, *args, **kwargs) - return resp - def form_valid(self, form): resp = super(GroupTemplateView, self).form_valid(form) @@ -156,7 +150,7 @@ class GroupTemplateView(CanEditMixin, DetailFormView): def get_form_kwargs(self): kwargs = super(GroupTemplateView, self).get_form_kwargs() - kwargs["users"] = self.users + kwargs["users"] = self.get_object().users.all() return kwargs