{% if link_id %} {% url 'jobs:link_edit' job.id link_id as action_url %} {% else %} {% url 'jobs:link_create' job.id as action_url %} {% endif %}