Skip to content

Commit

Permalink
temp:comment out unused legislation search logic in views.py
Browse files Browse the repository at this point in the history
Disable the code block responsible for searching and processing legislation within the ORP search views. This helps to reduce unnecessary execution of code when no search terms or specific document types are provided.
  • Loading branch information
hareshkainthdbt committed Oct 17, 2024
1 parent 341d998 commit 74f1fc6
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions orp/orp_search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,17 @@ def search(request: HttpRequest) -> HttpResponse:
# Legislation search
# If config.search_terms is empty then we don't need to
# search for legislation
if not config.search_terms or "" in config.search_terms:
logger.info("no search terms provided")
return render(request, template_name="orp.html", context=context)

if not config.document_types or "legislation" in config.document_types:
logger.info("searching for legislation: %s", config.search_terms)
legislation = Legislation()
legislation_results = legislation.search(config)
logger.info(f"legislation results: {legislation_results}")
context = legislation.finalise_results(
config, legislation_results, context
)
# if not config.search_terms or "" in config.search_terms:
# logger.info("no search terms provided")
# return render(request, template_name="orp.html", context=context)

# if not config.document_types or "legislation" in config.document_types:
# logger.info("searching for legislation: %s", config.search_terms)
# legislation = Legislation()
# legislation_results = legislation.search(config)
# logger.info(f"legislation results: {legislation_results}")
# context = legislation.finalise_results(
# config, legislation_results, context
# )

return render(request, template_name="orp.html", context=context)

0 comments on commit 74f1fc6

Please sign in to comment.