Do not double filter target_people in e-mail generation

Review Request #10193 — Created Oct. 3, 2018 and submitted — Latest diff uploaded

Information

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

Reviewers

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.