Skip to content

Commit

Permalink
refactor: Remove unused logs
Browse files Browse the repository at this point in the history
  • Loading branch information
petesfrench committed Sep 26, 2024
1 parent ee4b585 commit edeb9db
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions static/js/src/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ document.addEventListener("DOMContentLoaded", function () {
searchForm.addEventListener("submit", function (event) {
event.preventDefault();
const honeyPotField = searchForm.querySelector("input[name='search']");
// If the honeypot field has a value, it might be a bot, so redirect
if (honeyPotField && honeyPotField.value !== "") {
console.log("Honeypot field has a value, redirecting to search page");
window.location.replace("/search");
return;
}
// Remove the honeypot field before manual submission
if (honeyPotField) {
console.log("Removing honeypot field", honeyPotField);
honeyPotField.remove();
}
searchForm.submit();
Expand Down

0 comments on commit edeb9db

Please sign in to comment.