Skip to content

Commit

Permalink
FCL-448 | check for None on search before trying to get something fro…
Browse files Browse the repository at this point in the history
…m it
  • Loading branch information
jlhdxw committed Nov 26, 2024
1 parent 5542c1d commit 695ccc9
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions judgments/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,24 @@ def render_html(self, request):

search = self.get_object(request)

search_response: SearchResponse = search.get("search_response", {})
if search:
search_response: SearchResponse = search.get("search_response", {})

context["search_results"] = search_response.results
context["search_results"] = search_response.results

if query and form.is_valid():
cleaned_data = form.cleaned_data
query_param_string = urlencode(cleaned_data, doseq=True)
if query and form.is_valid():
cleaned_data = form.cleaned_data
query_param_string = urlencode(cleaned_data, doseq=True)

context["filters"] = cleaned_data.items()
context["query"] = query
context["query_param_string"] = query_param_string
context["filters"] = cleaned_data.items()
context["query"] = query
context["query_param_string"] = query_param_string

breadcrumbs = [
{"text": f'Search results for "{query}"', "url": "/judgments/search?" + query_param_string},
{"text": "Atom feed"},
]
context["breadcrumbs"] = breadcrumbs
breadcrumbs = [
{"text": f'Search results for "{query}"', "url": "/judgments/search?" + query_param_string},
{"text": "Atom feed"},
]
context["breadcrumbs"] = breadcrumbs

return render(request, "pages/atom_feed.html", context)

Expand Down

0 comments on commit 695ccc9

Please sign in to comment.