Opened 4 years ago

Closed 4 years ago

#12283 closed (duplicate)

Inclusion tags should handle arguments not present in the context gracefully

Reported by: kuon Owned by: nobody
Component: Template system Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


If we call an inclusion tag like that

{% my_tag object %}

and object is not present in the context, an exception will be raised, thus obliging us to do:

{% if object %}
{% my_tag object %}
{% else %}
{% my_tag %}
{% endif %}

It would be better to have the inclusion tag mechanism to handle keys not present in the context and just default them to None.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

Duplciate of #12212

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.