Skip to content
Snippets Groups Projects
Commit 2d4afe60 authored by sks444's avatar sks444
Browse files

Hide private partners page and its partner

parent fa4f70eb
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ import datetime
from django import forms
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.http import Http404
from django.shortcuts import redirect
from pagedown.widgets import PagedownWidget
from wagtail.admin.edit_handlers import FieldPanel
......@@ -97,6 +98,11 @@ class PartnerPage(BasePage):
category_questions[category.name] = [category.value]
return category_questions
def serve(self, request, *args, **kwargs):
if not self.public:
raise Http404
return super(PartnerPage, self).serve(request, *args, **kwargs)
def current_year():
return datetime.date.today().year
......
from django_filters.views import FilterView
from django_tables2.export.views import ExportMixin
from django_tables2.paginators import LazyPaginator
from django_tables2.views import SingleTableMixin
from django_tables2.export.views import ExportMixin
from .models import Investment
from .tables import InvestmentFilterAndSearch, InvestmentTable
......@@ -30,3 +30,6 @@ class InvestmentTableView(ExportMixin, SingleTableMixin, FilterView):
filter_action=self.filter_action,
**kwargs,
)
def get_queryset(self):
return Investment.objects.filter(partner__public=True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment