From cc99cecaa0c63ab3b4262a9e637ad54bcbb1d430 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Tue, 5 Dec 2017 15:53:36 +0100 Subject: [PATCH] Fix tab mixin on clubs --- club/views.py | 10 +++++----- com/views.py | 1 + core/templates/core/base.jinja | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/club/views.py b/club/views.py index ced6e169..d595d428 100644 --- a/club/views.py +++ b/club/views.py @@ -90,8 +90,6 @@ class ClubTabsMixin(TabedViewMixin): def get_tabs_title(self): if isinstance(self.object, PageRev): self.object = self.object.page.club - if isinstance(self.object, Poster): - self.object = self.club return self.object.get_display_name() def get_list_of_tabs(self): @@ -603,15 +601,17 @@ class MailingAutoCleanView(View): return redirect('club:mailing', club_id=self.mailing.club.id) -class PosterListView(PosterListBaseView, CanViewMixin, ClubTabsMixin): +class PosterListView(PosterListBaseView, ClubTabsMixin, CanViewMixin): """List communication posters""" - def dispatch(self, request, *args, **kwargs): - return super(PosterListView, self).dispatch(request, *args, **kwargs) + def get_object(self): + return self.club def get_context_data(self, **kwargs): kwargs = super(PosterListView, self).get_context_data(**kwargs) kwargs['app'] = "club" + kwargs['tabs_title'] = self.get_tabs_title() + kwargs['list_of_tabs'] = self.get_list_of_tabs() return kwargs diff --git a/com/views.py b/com/views.py index e9d4481d..74ff1b24 100644 --- a/com/views.py +++ b/com/views.py @@ -510,6 +510,7 @@ class PosterListBaseView(ListView): def dispatch(self, request, *args, **kwargs): club_id = kwargs.pop('club_id', None) + self.club = None if club_id: self.club = get_object_or_404(Club, pk=club_id) return super(PosterListBaseView, self).dispatch(request, *args, **kwargs) diff --git a/core/templates/core/base.jinja b/core/templates/core/base.jinja index eb0792bb..07dc9a63 100644 --- a/core/templates/core/base.jinja +++ b/core/templates/core/base.jinja @@ -169,7 +169,6 @@
- {{ object }} {% if list_of_tabs %}
{{ tabs_title }}