Skip to content
Snippets Groups Projects
Unverified Commit bff35436 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #963 from OpenTechFund/show-only-wagtail-forms

Forms section only display wagtail forms not apply
parents e89491bf 78b18a6d
Branches
Tags
No related merge requests found
from django.contrib.contenttypes.models import ContentType
from wagtail.core import hooks
from opentech.public.forms.models import FormPage
@hooks.register('filter_form_submissions_for_user')
def construct_from_wagtail_forms(user, queryset):
"""only show wagtail forms (hiding all the ones created from the apply app)."""
form_page_type = ContentType.objects.get_for_model(FormPage)
queryset = queryset.filter(content_type__pk=form_page_type.pk)
return queryset
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment