Do not double filter target_people in e-mail generation

Review Request #10193 — Created Oct. 4, 2018 and submitted

brennie
Review Board
release-3.0.x
1a3afca...
reviewboard

We are effectively doing the following ORM query when generating the
recipients for e-mails:

target_people = (
    review_request.target_people
    .filter(is_active=True)
    .filter(is_active=True)
)

which is (a) redundant and (b) seems to cause an incorrect query
result to occur on two of my machines, both running SQLite
3.25.2, which leads be to believe this is a bug in SQLite. In any
case, removing this second filter() clause fixes the issue.

I have inspected the generated query and nothing seems out of place in
the query with two filters (besides the fact that its WHERE clause
contains "auth_user"."is_active" = True twice.

Ran unit tests.

brennie
brennie
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (8d99ff1)
Loading...