Fix a crash when the search view is getting indexed.

Review Request #13642 — Created March 18, 2024 and submitted

Information

Review Board
release-6.x

Reviewers

A bad spider is sending some requests to the search view that are
causing error tracebacks. The issue here is that the form isn't valid,
but we were still trying to access cleaned_data. This change fixes
that up and tweaks stuff to make linters/static analysis happy.

Ran unit tests.

Summary ID
Fix a crash when the search view is getting indexed.
A bad spider is sending some requests to the search view that are causing error tracebacks. The issue here is that the form isn't valid, but we were still trying to access `cleaned_data`. This change fixes that up and tweaks stuff to make linters/static analysis happy. Testing Done: Ran unit tests.
604fc379e673347558460f2e03a751b819f483ae
Description From Last Updated

Is this applicable to 6.x?

chipx86chipx86

We need to define the active_filters variable outside of this if statement block too, otherwise if the form is not …

maubinmaubin

Missing a comma, newline, and return type.

chipx86chipx86
maubin
  1. 
      
  2. reviewboard/search/views.py (Diff revision 1)
     
     
    Show all issues

    We need to define the active_filters variable outside of this if statement block too, otherwise if the form is not valid active_filters will be undefined and cause a name error when we try to use it below.

  3. 
      
david
chipx86
  1. 
      
  2. Show all issues

    Is this applicable to 6.x?

    1. Actually it is, since that's what's deployed. Let's move that there.

  3. reviewboard/search/views.py (Diff revision 2)
     
     
    Show all issues

    Missing a comma, newline, and return type.

  4. 
      
david
maubin
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (f63bc36)