From 33c0220d2606136f75a5c2dde640f7acde23261d Mon Sep 17 00:00:00 2001 From: Dale Cannon Date: Fri, 22 Mar 2024 13:22:22 +0000 Subject: [PATCH] Pass sid values not objects for measure selections display list --- measures/jinja2/includes/measures/list.jinja | 4 ++-- measures/views.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/measures/jinja2/includes/measures/list.jinja b/measures/jinja2/includes/measures/list.jinja index c1661d57e..51e4fad86 100644 --- a/measures/jinja2/includes/measures/list.jinja +++ b/measures/jinja2/includes/measures/list.jinja @@ -116,9 +116,9 @@
{% if measure_selections %} {% set table_rows = [] %} - {% for measure in measure_selections %} + {% for sid in measure_selections %} {% set measure_link %} - {{measure.sid}} + {{sid}} {% endset %} {{ table_rows.append([ {"html": measure_link}, diff --git a/measures/views.py b/measures/views.py index 652a6c126..0717410a6 100644 --- a/measures/views.py +++ b/measures/views.py @@ -346,13 +346,10 @@ def get_context_data(self, **kwargs): if context["has_next_page"]: context["next_page_number"] = page.next_page_number() - measure_selections = [ - SelectableObjectsForm.object_id_from_field_name(name) - for name in self.measure_selections - ] context["measure_selections"] = models.Measure.objects.filter( - pk__in=measure_selections, - ) + pk__in=self.measure_selections, + ).values_list("sid", flat=True) + context["query_params"] = True context[ "base_url"