Skip to content

Commit

Permalink
Include measure tag in dashboard URL
Browse files Browse the repository at this point in the history
By default the dashboard only displays measures tagged `core`. This
means that for non-core measures the URL, which is supposed to use a
fragment to highlight the target measure, ends up pointing to a page
which doesn't have that measure on at all.
  • Loading branch information
evansd committed Oct 25, 2024
1 parent ec84b5c commit bb8a9cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openprescribing/frontend/templatetags/template_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def username_from_email(email):
@register.simple_tag(takes_context=True)
def dashboard_measure_uri(context, measure):
return format_html(
"{}#{}",
"{}&tags={}#{}",
context["dashboard_uri"],
# It doesn't matter which tag we chose, it just needs to be one that the target
# measure has so we know it will appear on the linked dashboard
measure.tags[0],
measure.id,
)

0 comments on commit bb8a9cd

Please sign in to comment.