Add status filter into search

This commit is contained in:
Stefan Wehrmeyer 2022-03-18 14:25:41 +01:00
parent 977b13b556
commit fc7cac3184
2 changed files with 10 additions and 2 deletions

View file

@ -9,6 +9,7 @@ from .models import (
GovernmentPlanSection,
GovernmentPlanSectionsCMSPlugin,
GovernmentPlanUpdatesCMSPlugin,
PlanStatus,
)
@ -25,6 +26,7 @@ class GovernmentPlansPlugin(CMSPluginBase):
def render(self, context, instance, placeholder):
context = super().render(context, instance, placeholder)
context["plugin"] = instance
context["status_list"] = PlanStatus.choices
context["object_list"] = instance.get_plans(
context["request"], published_only=False
)