Use bool instead of int for boolean filter value

At this layer, it's a boolean filter; we should let the ORM
make the translation for whatever backend is in use.  MySQL
didn't care, but PostgreSQL is a bit more picky.

Co-authored-by: Scott McClymont <scott.mcclymont@verizonwireless.com>
Co-authored-by: Brian Rosmaita <rosmaita.fossdev@gmail.com>

Change-Id: Id1e5d2cec3be48f6a5164582591f2fd2f565a96b
Closes-bug: #1749297
(cherry picked from commit bac4595e08)
This commit is contained in:
Brian Rosmaita 2018-02-13 16:42:51 -05:00
parent eb6bd06654
commit 5501f905ac
1 changed files with 2 additions and 2 deletions

View File

@ -1469,9 +1469,9 @@ def _task_soft_delete(context, session=None):
query = session.query(models.Task)
query = (query.filter(models.Task.owner == context.owner)
.filter_by(deleted=0)
.filter_by(deleted=False)
.filter(expires_at <= timeutils.utcnow()))
values = {'deleted': 1, 'deleted_at': timeutils.utcnow()}
values = {'deleted': True, 'deleted_at': timeutils.utcnow()}
with session.begin():
query.update(values)