westerveltco / wagtail-heroicons

Add Heroicons to the Wagtail admin.
Other
5 stars 2 forks source link

"TypeError: '<' not supported between instances of 'PosixPath' and 'str'" whenever using wagtail_heroicons #40

Closed ReijerBoodt closed 1 year ago

ReijerBoodt commented 1 year ago

Adding "wagtail_heroicons" to INSTALLED_APPS gives the following error (on the latest version of Wagtail, on linux)

  File "/home/reijer/.pyenv/versions/clean-test/lib/python3.10/site-packages/wagtail/admin/views/home.py", line 388, in sprite
    return HttpResponse(icons())
  File "/home/reijer/.pyenv/versions/clean-test/lib/python3.10/site-packages/wagtail/admin/views/home.py", line 368, in icons
    all_icons = sorted(
TypeError: '<' not supported between instances of 'PosixPath' and 'str'

Steps to reproduce

Changing line 14 of src/wagtail_heroicons/wagtail_hooks.py to read icons.append(str(icon.path)) instead of icons.append(icon.path) fixes the issue.

joshuadavidthomas commented 1 year ago

Thanks for the detailed report. I just ran in to this myself this morning as well.

joshuadavidthomas commented 1 year ago

I merged in #41 and just cut a new release v0.1.3 that should be on PyPI now. Thanks!