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.
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 Modelschartclicking on this device filter
Generated URL:
/admin/config/device/?model__exact=Dongwon+T%26amp%3BI+DW02-412H+%28128M%29which is double encoded
Expected behavior
Correct URL:
/admin/config/device/?model__exact=Dongwon%20T%26I%20DW02-412H%20%28128M%29System typechart generates correct htmlSystem Information:
I have changed this
openwisp-utils/openwisp_utils/admin_theme/dashboard.py
Line 221 in f6305c4
to
label = (label)works for me, i do not know if this is the correct approach or not.