Skip to content

Commit

Permalink
ECIL-225 Test coverage for admin templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeylockwood committed Nov 28, 2024
1 parent 09c414f commit 3228e6a
Show file tree
Hide file tree
Showing 3 changed files with 422 additions and 15 deletions.
3 changes: 3 additions & 0 deletions pii-ner-exclude.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5169,3 +5169,6 @@ xlsb
print(actual_html
date_input_field_1
{{ gds.govukErrorSummary(form.error_summary_kwargs
versions__content__icontains
EXPORTER_ADDRESS_FLAT]]
para_EU_COSMETICS_RESPONSIBLE_PERSON_NI
6 changes: 5 additions & 1 deletion web/domains/template/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
class EndorsementTemplateWidget(ICMSModelSelect2Widget):
search_fields = [
"template_name__icontains",
"template_content__icontains",
"versions__content__icontains",
]

def filter_queryset(self, request, term, queryset=None, **dependent_fields):
qs = super().filter_queryset(request, term, queryset, **dependent_fields)
return qs.filter(versions__is_active=True)
Loading

0 comments on commit 3228e6a

Please sign in to comment.