From 992c8b8c4aacfb7ba74a9b61a2c09eeace183d97 Mon Sep 17 00:00:00 2001 From: Williams Date: Tue, 13 Feb 2024 14:11:46 -0500 Subject: [PATCH] Fixing the latest PK for new compression scheme --- tr_sys/tr_ars/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr_sys/tr_ars/api.py b/tr_sys/tr_ars/api.py index eb1bff58..d7386076 100644 --- a/tr_sys/tr_ars/api.py +++ b/tr_sys/tr_ars/api.py @@ -406,9 +406,9 @@ def latest_pk(req, n): if actor.agent.name == 'ars-default-agent': actor_id = actor.id - mesg_list = Message.objects.filter(actor=actor_id).order_by('-timestamp')[:n] + mesg_list = Message.objects.values('actor','timestamp','id').filter(actor=actor_id).order_by('-timestamp')[:n] for mesg in mesg_list: - response[f'latest_{n}_pks'].append(str(mesg.pk)) + response[f'latest_{n}_pks'].append(str(mesg['id'])) return HttpResponse(json.dumps(response, indent=2), status=200)