Opened 8 years ago
Last modified 8 years ago
#29060 closed Bug
FirstOf with an 'as' clause has confusing behaviour in all false case — at Version 1
| Reported by: | Roger Gammans | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | 1.8 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I have verified this in version 1.8 and 2.0.
firstof with an 'as' clause doesn't set; or reset the target context variable if all parameters are false. I would expect the context variable to be set to None or the empty string to match the replacement mode behaviour of the tag.
As per summary.; Will add reference to a PR 9618 ( https://github.com/django/django/pull/9618 ) has a fix and example unittest
Note:
See TracTickets
for help on using tickets.