Skip to content

[bug] Double Encoding in Admin Dashboard Device Models segment #651

@momothefox

Description

@momothefox

Clicking on dashboard Device Models pie chart segments generates incorrect filter URLs when labels contain special characters such as "&".

Steps To Reproduce
Device model:
Dongwon T&I DW02-412H (128M)

In Admin dashboard Network Administration
Device Models chart
clicking on this device filter

Generated URL:
/admin/config/device/?model__exact=Dongwon+T%26amp%3BI+DW02-412H+%28128M%29

which is double encoded

Expected behavior
Correct URL:
/admin/config/device/?model__exact=Dongwon%20T%26I%20DW02-412H%20%28128M%29

System type chart generates correct html

System Information:

  • OS: [Ubuntu 22 LTS]
  • Python Version: [3.10.12]
  • Django Version: [Django 5.2.11]
  • Browser and Browser Version: [Chrome v147.0.7727.57]

I have changed this

label = html.escape(label)

to label = (label)

works for me, i do not know if this is the correct approach or not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    Status

    Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions