{% set hash = app.request.get('hash') %} {% set use_hash = hash is not empty %} {% if gift is not empty or use_hash %} {% set invitationAccepted = false %} {% for inv in gift.invitation %} {% if inv.vUser.id == vUser.id and inv.confirmedAt is not empty %} {% set invitationAccepted = true %} {% endif %} {% endfor %} {% endif %}