Made 'default' and 'default_if_none' filters bypass FastDev template exceptions#57
Merged
boxed merged 13 commits intoboxed:masterfrom May 15, 2025
Merged
Made 'default' and 'default_if_none' filters bypass FastDev template exceptions#57boxed merged 13 commits intoboxed:masterfrom
boxed merged 13 commits intoboxed:masterfrom
Conversation
Owner
|
I like it! Could you add a trivial test for this? |
Owner
|
I removed the behavior that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this change makes it so that non-existent context variables in templates will not raise a FastDev exception if they are being filtered by |default or |default_if_none. instead, it defaults to standard Django template behavior, returning None on the lookup, which gets passed to either of those filters. this is probably what most people would have expected as standard behavior from FastDev in templates–it certainly makes sense and is a succinct way to populate a dubious context variable that may or may not have been declared in the view context.