Mercurial > libervia-backend
changeset 4160:6a0066ea5c97
core (memory/sqla): add `id` filter in `history_get`
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 28 Nov 2023 17:26:45 +0100 |
parents | 54b8cf8c8daf |
children | 2074b2bbe616 |
files | libervia/backend/memory/sqla.py |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libervia/backend/memory/sqla.py Tue Nov 28 17:25:47 2023 +0100 +++ b/libervia/backend/memory/sqla.py Tue Nov 28 17:26:45 2023 +0100 @@ -616,6 +616,8 @@ if filters["last_stanza_id"] is not True or limit != 1: raise ValueError("Unexpected values for last_stanza_id filter") stmt = stmt.where(History.stanza_id.is_not(None)) + if "id" in filters: + stmt = stmt.where(History.uid == filters["id"]) if "origin_id" in filters: stmt = stmt.where(History.origin_id == filters["origin_id"])