Fix {% template_hook_point %} when using RequestContext.
Review Request #14155 — Created Sept. 11, 2024 and submitted
In the case of unit tests, we may be rendering some templates that
include{% template_hook_point %}
without going through all our usual
context processor machinery. In this case, we can sometimes hit cases
where we're calling this tag with aRequestContext
that does not
actually haverequest
in the dict contents. This was causing some unit
test failures.This change makes it so our template tag will check if we have a
RequestContext
, and if so, get the request from the attribute instead
of trying to pull it out of the dict. This fixes the cases where unit
tests were crashing.
Ran tests in both Djblets and Review Board (the latter being where I
was hitting these issues).
Summary | ID |
---|---|
71741e401f4e21aff2667fba8d0da3c8a91f8e57 |
Description | From | Last Updated |
---|---|---|
I think we want to type variables only once (probably before the conditional). I've had type checkers yell at me … |
chipx86 |