reactivated
reactivated copied to clipboard
Fixes `Invariant in union serialization` when the value is a LazyObject
Seems like something we need, but I'd like to understand the use case.
How do you end up with a lazy object? Maybe our test can better reflect that, instead of direct instantiation. I don't think it needs to be a union test though, just handling of values in general. Happy to re-arrange after you let me know though.
Also remember you can run scripts/fix.sh
at the root to fix formatting/style issues.
Seems like something we need, but I'd like to understand the use case. How do you end up with a lazy object?
I encountered this exception due to request.csp_nonce
(from django-csp) being a lazy object.
https://github.com/mozilla/django-csp/blob/main/csp/middleware.py#L32
For the test, I was just replicating the exact exception I was trying to fix. But you're right, it doesn't have to be a union test.
@crgwbr sorry to intervene, do you think this could be used to pass gettext_lazy
strings to templates as well?
@crgwbr sorry to intervene, do you think this could be used to pass
gettext_lazy
strings to templates as well?
Yeah, absolutely.
@crgwbr this is ready to go, but I need you to make an empty commit git commit --allow-empty -m "Trigger Build"
so CI runs as you and the website tests are skipped.
@silviogutierrez Done, but did it as a rebase instead to avoid the extra junk commits.
@crgwbr : thanks, note that's not necessary because all commits on this project are squash & merge, so you'll only see a single commit in the main log.
[Cue religious war]