Do not double filter target_people in e-mail generation
Review Request #10193 — Created Oct. 3, 2018 and submitted
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 secondfilter()
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 itsWHERE
clause
contains"auth_user"."is_active" = True
twice.
Ran unit tests.
- Description:
-
We are effectively doing the following ORM query when generating the
~ recipients for e-mais: ~ 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 my machine. Removing this second filter()
clausefixes 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
clausecontains "auth_user"."is_active" = True
twice.
- Description:
-
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 my machine. Removing this second filter()
clause~ fixes the issue. ~ 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
clausecontains "auth_user"."is_active" = True
twice. - Branch:
-
release-4.0.xrelease-3.0.x