How to make a variable in jijna2 default to \"\" if object is None instead of doing something like this?
{% if p %} {{ p.User[\'first_name\'
As another solution (kind of similar to some previous ones):
{{ ( p is defined and p.User is defined and p.User['first_name'] ) |default("NONE", True) }}
Note the last variable (p.User['first_name']) does not have the if defined test after it.
if defined