westerveltco / wagtail-heroicons

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

TemplateDoesNotExist exception on startup #58

Closed seb-b closed 4 months ago

seb-b commented 4 months ago

Just got stung by this because I didn't pin to 0.1.3. I'm using hero-icons in a ModelAdmin using Wagtail 5.2 modeladmin def looks something like this:

class CourseCompletionAdmin(ModelAdmin):
    model = CourseCompletion
    menu_icon = "heroicons-academic-cap-solid"
    menu_label = "Course completions"
    list_display = ("email", "course", "date_completed")

exception on startup -

... our app code that basically imports wagtail urls ...
File "wagtail/admin/urls/__init__.py", line 138, in <module>
  path(f"sprite-{get_sprite_hash()}/", home.sprite, name="wagtailadmin_sprite"),
File "wagtail/admin/urls/__init__.py", line 129, in get_sprite_hash
  content = str(home.sprite(None).content, "utf-8")
File "wagtail/admin/views/home.py", line 429, in sprite
  return HttpResponse(icons())
File "wagtail/admin/views/home.py", line 415, in icons
  render_to_string(icon)
File "django/template/loader.py", line 61, in render_to_string
  template = get_template(template_name, using=using)
File "django/template/loader.py", line 19, in get_template
  raise TemplateDoesNotExist(template_name, chain=chain)

Works ok after downgrading

joshuadavidthomas commented 4 months ago

Ah, that's what I get for getting overly confident because I got to 100% code coverage. 😆

Thanks for the bug report and the traceback. There's enough here to chase this down.

joshuadavidthomas commented 4 months ago

Fixed in v0.2.2 🎉