carltongibson / django-template-partials

Reusable named inline partials for the Django Template Language.
MIT License
444 stars 16 forks source link

'TemplateProxy' object has no attribute 'get_exception_info' #1

Closed hvdklauw closed 1 year ago

hvdklauw commented 1 year ago

Happens when I used a model that wasn't migrated yet, so there was probably some underlaying database error.

The line that threw the error was the partial template tag.

carltongibson commented 1 year ago

OK, yes, that's for the debug template. (At least the bottom part of the traceback would be helpful.)

TemplateProxy should likely implement something here, so as not to error.

Fancy doing that?

hvdklauw commented 1 year ago

Yes, was already looking at what was needed.

carltongibson commented 1 year ago

Great. Thanks. For first pass, something minimal would be enough. (I don't know we need to copy too much from Django...)

hvdklauw commented 1 year ago

That's what I did first, but then I figured out how to use the one from the actual template, which is much nicer.

Not sure if the test is the correct way to test if the exception is handled correctly or not, couldn't find a lot of documentation in django on how to test the template debugging, except just catching it and checking the values.

carltongibson commented 1 year ago

Great thanks. Let me have a look.