Skip to content

Commit f9453b9

Browse files
StephDrivermauromsl
authored andcommitted
a11y: openlibhums#4839 full-text-search move id from view to class
1 parent 1feef7e commit f9453b9

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/journal/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def __init__(self, data=None, *args, **kwargs):
9898
self.data[search_filter] = "on"
9999
self.label_suffix = ""
100100

101+
self.id = "search_form"
102+
101103
article_search = forms.CharField(
102104
label=_("Search term"), min_length=3, max_length=100, required=False
103105
)

src/journal/views.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,8 +2242,6 @@ def full_text_search(request):
22422242
request,
22432243
)
22442244

2245-
form.id = "search_form"
2246-
22472245
if search_term:
22482246
form.is_valid()
22492247
articles = submission_models.Article.objects.search(
@@ -2271,12 +2269,9 @@ def full_text_search(request):
22712269
"page_obj": page_obj,
22722270
"is_paginated": page_obj.has_other_pages(),
22732271
"paginate_by": paginate_by,
2274-
"article_search": search_term,
2272+
"search_term": search_term,
22752273
"keyword": keyword,
22762274
"form": form,
2277-
"facet_form": form,
2278-
"order_by_choices": form.fields["sort"].choices,
2279-
"order_by": sort,
22802275
}
22812276

22822277
return render(request, template, context)

0 commit comments

Comments
 (0)