From d12a18d89c74a3758fe2951d75568445450ad661 Mon Sep 17 00:00:00 2001 From: xenua Date: Sun, 19 Jun 2022 09:09:45 +0200 Subject: [PATCH] make overview link list include all domains, not just current one --- leftists/views.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/leftists/views.py b/leftists/views.py index 39b3b67..bba9b28 100644 --- a/leftists/views.py +++ b/leftists/views.py @@ -3,6 +3,7 @@ from django.contrib.auth.views import LoginView from django.shortcuts import get_object_or_404 from django.urls import reverse_lazy from django.views.generic import RedirectView, TemplateView, CreateView, UpdateView, DeleteView +from django_scopes import scopes_disabled from scopedsites.models import Domain from leftists.forms import LinkForm @@ -25,14 +26,15 @@ class OverView(LoginRequiredMixin, TemplateView): template_name = 'interface/overview.html' def get_context_data(self, **kwargs): - ctx = super().get_context_data(**kwargs) - ds = Domain.objects.all() - ctx.setdefault('domains', ds) - links = [] - for d in ds: - [links.append(l) for l in d.links.all()] - ctx.setdefault('links', links) - return ctx + with scopes_disabled(): + ctx = super().get_context_data(**kwargs) + ds = Domain.objects.all() + ctx.setdefault('domains', ds) + links = [] + for d in ds: + [links.append(l) for l in d.links.all()] + ctx.setdefault('links', links) + return ctx class LinkCreateView(LoginRequiredMixin, CreateView):